Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1725531

[PATCH 3/3] checkpatch: add 6 missing types to --list-types

From Jean Delvare <jdelvare@suse.de>
Newsgroups linux.kernel
Subject [PATCH 3/3] checkpatch: add 6 missing types to --list-types
Date 2017-09-02 18:00 +0200
Message-ID <uliZY-4Mu-33@gated-at.bofh.it> (permalink)
References <uliZY-4Mu-21@gated-at.bofh.it>
Organization SUSE Linux

Show all headers | View raw


Unlike all other types, LONG_LINE, LONG_LINE_COMMENT and
LONG_LINE_STRING are passed to WARN() through a variable. This causes
the parser in list_types() to miss them and consequently they are not
present in the output of --list-types.

Additionally, types TYPO_SPELLING, FSF_MAILING_ADDRESS and AVOID_BUG
are passed with a variable level, causing the parser to miss them
too.

So modify the regex to also catch these special cases.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: 3beb42eced39 ("checkpatch: add --list-types to show message types to show or ignore")
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-4.13-rc7.orig/scripts/checkpatch.pl	2017-09-02 17:46:45.852024037 +0200
+++ linux-4.13-rc7/scripts/checkpatch.pl	2017-09-02 17:46:55.925163818 +0200
@@ -145,7 +145,8 @@ sub list_types {
 	close($script);
 
 	my @types = ();
-	for ($text =~ /\b(?:(?:CHK|WARN|ERROR)\s*\(\s*"([^"]+)")/g) {
+	# Also catch when type or level is passed through a variable
+	for ($text =~ /(?:(?:\bCHK|\bWARN|\bERROR|&\{\$msg_level})\s*\(|\$msg_type\s*=)\s*"([^"]+)"/g) {
 		push (@types, $_);
 	}
 	@types = sort(uniq(@types));

-- 
Jean Delvare
SUSE L3 Support

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] Add missing types to checkpatch.pl --list-types Jean Delvare <jdelvare@suse.de> - 2017-09-02 18:00 +0200
  [PATCH 2/3] checkpatch: rename variables to avoid confusion Jean Delvare <jdelvare@suse.de> - 2017-09-02 18:00 +0200
  [PATCH 3/3] checkpatch: add 6 missing types to --list-types Jean Delvare <jdelvare@suse.de> - 2017-09-02 18:00 +0200
  Re: [PATCH 0/3] Add missing types to checkpatch.pl --list-types Joe Perches <joe@perches.com> - 2017-09-02 18:30 +0200
    Re: [PATCH 0/3] Add missing types to checkpatch.pl --list-types Jean Delvare <jdelvare@suse.de> - 2017-09-02 21:20 +0200
      Re: [PATCH 0/3] Add missing types to checkpatch.pl --list-types Jean Delvare <jdelvare@suse.de> - 2017-09-02 23:10 +0200
        Re: [PATCH 0/3] Add missing types to checkpatch.pl --list-types Joe Perches <joe@perches.com> - 2017-09-03 01:00 +0200
          Re: [PATCH 0/3] Add missing types to checkpatch.pl --list-types Jean Delvare <jdelvare@suse.de> - 2017-09-04 10:10 +0200

csiph-web