mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vadim Bendebury <vbendeb@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: apw@canonical.com, joe@perches.com,
	Vadim Bendebury <vbendeb@chromium.org>
Subject: [PATCH] checkpatch: allow reporting C99 style comments
Date: Thu, 10 Jan 2019 14:49:57 -0800	[thread overview]
Message-ID: <20190110224957.25008-1-vbendeb@chromium.org> (raw)
In-Reply-To: <20190110050117.55349-1-vbendeb@chromium.org>

Presently C99 style comments are removed unconditionally before actual
patch validity check happens. This is a problem for some third party
projects which use checkpatch.pl but do not allow C99 style comments.

This patch adds yet another variable, named C99_COMMENT_TOLERANCE. If
it is included in the --ignore command line or config file options
list, C99 comments in the patch are reported as errors.

Tested by processing a patch with a C99 style comment, it passes the
check just fine unless '--ignore C99_COMMENT_TOLERANCE' is present in
.checkpatch.conf.

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b737ca9d7204..8a1aaeb8fa1b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -61,7 +61,7 @@ my $codespellfile = "/usr/share/codespell/dictionary.txt";
 my $conststructsfile = "$D/const_structs.checkpatch";
 my $typedefsfile = "";
 my $color = "auto";
-my $allow_c99_comments = 1;
+my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE
 
 sub help {
 	my ($exitcode) = @_;
@@ -1011,6 +1011,7 @@ if ($git) {
 }
 
 my $vname;
+$allow_c99_comments = !defined $ignore_type{"C99_COMMENT_TOLERANCE"};
 for my $filename (@ARGV) {
 	my $FILE;
 	if ($git) {
-- 
2.17.1


  parent reply	other threads:[~2019-01-10 22:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10  5:01 Vadim Bendebury
2019-01-10 20:24 ` Joe Perches
2019-01-10 22:49 ` Vadim Bendebury [this message]
2019-01-10 23:16   ` Joe Perches
     [not found]     ` <CAC3GErFi6Hg-E81wpwDV6gpWD0pxM6Rcbj-J9Q6Rs1FOuZ3fNA@mail.gmail.com>
2019-01-11 19:11       ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190110224957.25008-1-vbendeb@chromium.org \
    --to=vbendeb@chromium.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®