Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3426893pxv; Sun, 18 Jul 2021 23:00:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFkt9Q1R8WG6DbT1HK9cRdRhTR3uPYx+Mv1fG1Y0WtTQG3HJyBZu0p3gEnweRN186MxhIN X-Received: by 2002:a05:6402:10cc:: with SMTP id p12mr32769337edu.328.1626674443931; Sun, 18 Jul 2021 23:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626674443; cv=none; d=google.com; s=arc-20160816; b=jgd7zmaiakX6hykOptWVrrC4lg4R2F4qpkJgSiTgBAI+EZchV1xk+DZK1w/fBp3cbf XIpzRbkDpHZ38oF2U8J2foL+iuUxBwgXXD8yrEvO+g1kf0vpeKBKZsTQDtVA/MC9SRNo AetNd+0Fxs8Vo8LJcOgnMpAD7sC3UkkMSnBooIH//+VIBHeHsxwZSZVIASuty24h60uK tOaVC33Q9ExQwQtHQY1iRU426pzJl+omVEf0d7NcJG373Zms86L9lUMXp1OmcqG1KPW6 q+Yzw837lKDcdA7dSEgQQecpWcr5G+Gg4XUM/OIlwlQQl/ohx5ulneacKThilIpsgIAn Z8aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xSPuZ3a4uXlxuhdBRuBaWJal0g7rnXic+tEbYjedUiM=; b=0ZsTa0HYv0kH/KT8zDW/toHF6YuSWgz1OxkNel3ajM8Yd684vgeoSs+lwtPQPHe/BF FL2Sg0+uZsPDw4MbFcOkAfUj+rx5Y02pa6tqRpk/Yh1C2ZXSFFUMc+vKCVUQC8knr2i/ AC6P/h9re3aeJq/BgPnKLhZwValz4Y6Qha5cG44fm78yc1OSgzLdIXo/+76OEF1A20e5 eKo5xR4xNzMhaJf1EW8g9m6GPQfT5E6+Iv2p7KwEofSCqT2eKqjF0ENm6D8TAiX7ji/8 vMOx5TzfA6kiFgmXZW6DyeJ3av99WId4eTZ62gATMW6wYCHKzaUp1KP4xP5VdrDzwPvx en9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MYLiyAnd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd28si20755614ejc.701.2021.07.18.23.00.21; Sun, 18 Jul 2021 23:00:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MYLiyAnd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234342AbhGSGCH (ORCPT + 99 others); Mon, 19 Jul 2021 02:02:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234187AbhGSGCG (ORCPT ); Mon, 19 Jul 2021 02:02:06 -0400 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 227F0C061765 for ; Sun, 18 Jul 2021 22:59:07 -0700 (PDT) Received: by mail-yb1-xb2b.google.com with SMTP id v189so26052722ybg.3 for ; Sun, 18 Jul 2021 22:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xSPuZ3a4uXlxuhdBRuBaWJal0g7rnXic+tEbYjedUiM=; b=MYLiyAndFeOsRMonNV1uTiW1aT0ReE48tJbTy1f2ohcCd8J5LHXGtGKeVLU44Qpgq4 gXJ1BuMSB2lybCeZhBdJ21z53jidFmfOC15Stc+rlQmv3PlK0UPx1PTvrkAS+Odjn/If 58IKyvppHNaNVlLw48TTFaw4E35JJGsmHVLLkGfs09kaSyFcITGyafYs+nCjm1p7tO6I bvspldhTVKurrPtqVzfB0l0PrJ7UaxhsqjUcolV8rGdbj2dhb0dkBwjBavEXiynebszs oploIffizzn8I1VXNzfa7uV4zNpKxGw9QnHe9QwBk0EiPg6PwqwIDmUpbUdrrpdYqjpQ c7CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xSPuZ3a4uXlxuhdBRuBaWJal0g7rnXic+tEbYjedUiM=; b=ahu74F9AH8v7FspSlth9zjZIMIistTGXSzNkZamM7+33Nv/8ektcDAaJab4FUZwwmk X7xSJzeNRbb2X194pTLSTW2jVfXNH7Al9/Hr8UDHc2seKQMQ7mveJ57MU65m9tTc3mWk jZw8te5JVXBkgH0OdPKVUph4MZ/MLO0cg+exIQA6Cz2euawqpmDODJNrbhRXuxmYU2WN Ec2tnld4GJKsBUL2MCbwVMDQdvAjwVrckkQ+TtGGMXrnygcBAUOkXyy3/TPbXftJssGY Mo59MnlJij0Fp5JKNtOwlnphF20/1HKKk8+3aGVM3eDXiHd71b21YuuThYyPgRLVUBRl TyFA== X-Gm-Message-State: AOAM531OXPottlYUrBBUNqgv3qO6hhOm5aVqkdSXX7SMD4HkYB04waIf dhgL9vhzZwo1Atogk36etJEQTv2xolG6pJXuxHk= X-Received: by 2002:a25:ca54:: with SMTP id a81mr9674817ybg.157.1626674346276; Sun, 18 Jul 2021 22:59:06 -0700 (PDT) MIME-Version: 1.0 References: <20210714063422.2164699-1-ani@anisinha.ca> In-Reply-To: From: Lukas Bulwahn Date: Mon, 19 Jul 2021 07:58:55 +0200 Message-ID: Subject: Re: [PATCH v3] checkpatch: add a rule to check general block comment style To: Ani Sinha Cc: Joe Perches , Linux Kernel Mailing List , anirban.sinha@nokia.com, mikelley@microsoft.com, Andy Whitcroft , Dwaipayan Ray Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 19, 2021 at 7:28 AM Ani Sinha wrote: > > > > On Sun, 18 Jul 2021, Joe Perches wrote: > > > On Sun, 2021-07-18 at 19:08 +0530, Ani Sinha wrote: > > > On Sun, 18 Jul 2021, Lukas Bulwahn wrote: > > > > On Fri, Jul 16, 2021 at 6:15 PM Ani Sinha wrote: > > > > > checkpatch maintainers, any comments? > > > > > On Wed, 14 Jul 2021, Ani Sinha wrote: > > > > > > The preferred style for long (multi-line) comments is: > > > > > > > > > > > > .. code-block:: c > > > > > > > > > > > > /* > > > > > > * This is the preferred style for multi-line > > > > > > * comments in the Linux kernel source code. > > > > > > * Please use it consistently. > > > > > > * > > > > > > * Description: A column of asterisks on the left side, > > > > > > * with beginning and ending almost-blank lines. > > > > > > */ > > > > > > > > > > > > It seems rule in checkpatch.pl is missing to ensure this for > > > > > > non-networking related changes. This patch adds this rule. > > [] > > > > Honest feedback: IMHO, your commit message is unreadable and incomprehensible. > > > > > > OK. However, I fail to see how your above comment is useful without any > > > suggestion as to how to improve the commit log. I find having some test > > > data with the commit message valuable so that there is some sort of record > > > as to how the change was tested and with what arguments. Beyond that this > > > is not something I am really worried about. The commit message can be > > > modified and improved in any way reviewers like. > > > > > > > > > > > Now to the feature you are proposing: > > > > > > > > I do not think that it is good if checkpatch would point out a quite > > > > trivial syntactic issue that probably is currently violated many times > > > > (>10,000 or even >100,000 times?) in the overall repository. That will > > > > make checkpatch warn on many commits with this check and divert the > > > > attention from other checks that are more important than the style of > > > > starting comments. > > > > > > I have some strong opinions on this. Just because a rule has been violated > > > in the past does not mean it can continue to be violated in the future. > > > > Intensity of opinion varies considerably here. > > > > > > Further, some evaluation by Aditya shows that the distinction between > > > > NETWORKING COMMENT STYLE and GENERAL KERNEL COMMENT STYLE is not as > > > > easily split as currently encoded in the checkpatch script, > > > > https://lore.kernel.org/linux-kernel-mentees/cfff5784-9ca3-07f8-c51c-f1c82b2871e3@gmail.com/. > > > > So, this checkpatch check is largely wrong already as of now and most > > > > probably ignored by many contributors. > > > > The only reason the rule exists at all is because the networking maintainer > > was constantly telling people to change the comment style in patches. > > > > I don't care one way or another. > > > > // comments are fine > > /* comments are fine */ > > > > In networking, multiline comments are almost exclusively like > > what Linus himself does not like: > > > > /* comment > > * ... > > */ > > > > but in other subsystems, the styles of multiline comments varies. > > > > Either works, there is no single standard. > > > > OK then in that case, maybe update > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v5.14-rc2#n584 > The rule may still hold. > It is confusing to patch submitters (and it happened to me with a recent > patch) that the reviewer insists on a particular commenting style when > checkpatch does not enforce it. Its confusing for reviewers too. > I think this is more about the confusion of what you should really expect from checkpatch. Checkpatch does some checking, but this checking is not sound, i.e., perfect wrt. expectations on submissions, i.e., there are various cases where checkpatch's suggestion is NOT the community's/maintainer's preference. Some rules are even quite basic heuristics, and can get confused by unexpected patterns. Hence, in its current state, with all rules enabled, you could not enforce a checkpatch pre-commit hook as you suggested. Further, checkpatch is not complete either: just because checkpatch did not complain on some stylistic issues does not mean that all rules on style that might be automatically checkable are followed in a patch. During the patch submission, reviewers might still ask for further stylistic improvements, even if checkpatch did not point them out. Contributing to checkpatch improvements is certainly welcome. However, it is a non-trivial task to include checks that make checkpatch more usable (more accepted among developers and maintainers) with the current submission practice and the currently existing code in the kernel repository. Lukas > > > And as the referenced link by Aditya somewhat shows, the nominal > > rule compliance varies by the age of the code. No one care much > > about code submitted a couple decades ago for subsystems and drivers > > that are effectively obsolete... > > > > > >