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


Groups > linux.kernel > #1283477

Re: [BUG] checkpatch: false positive for commits with quote characters

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [BUG] checkpatch: false positive for commits with quote characters
Date 2015-12-04 01:30 +0100
Message-ID <qBMq6-3PE-1@gated-at.bofh.it> (permalink)
References <qvAL0-4US-17@gated-at.bofh.it> <qvSyg-8a9-29@gated-at.bofh.it> <qvSRC-8wu-45@gated-at.bofh.it> <qBMgq-3Ms-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2015-12-03 at 16:13 -0800, Brian Norris wrote:
> Ping? I've hit some different false positives today on the same rule.
> I'll stop bothering to report them if no one cares.

Perhaps this:
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9f0949b..196b77b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2397,22 +2397,26 @@ sub process {
 			$long = 1 if ($line =~ /\bcommit\s+[0-9a-f]{41,}/i);
 			$space = 0 if ($line =~ /\bcommit [0-9a-f]/i);
 			$case = 0 if ($line =~ /\b[Cc]ommit\s+[0-9a-f]{5,40}[^A-F]/);
-			if ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)"\)/i) {
+			if ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("(.*)"\)/i) {
 				$orig_desc = $1;
 				$hasparens = 1;
+				print("here1\n");
 			} elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s*$/i &&
 				 defined $rawlines[$linenr] &&
-				 $rawlines[$linenr] =~ /^\s*\("([^"]+)"\)/) {
+				 $rawlines[$linenr] =~ /^\s*\("(.*)"\)/) {
 				$orig_desc = $1;
 				$hasparens = 1;
+				print("here2\n");
 			} elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("[^"]+$/i &&
 				 defined $rawlines[$linenr] &&
-				 $rawlines[$linenr] =~ /^\s*[^"]+"\)/) {
+				 $rawlines[$linenr] =~ /^\s*.*"\)/) {
 				$line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)$/i;
 				$orig_desc = $1;
-				$rawlines[$linenr] =~ /^\s*([^"]+)"\)/;
+				$rawlines[$linenr] =~ /^\s*(.*)"\)/;
 				$orig_desc .= " " . $1;
 				$hasparens = 1;
+				print("orig_desc: <$orig_desc>\n");
+				print("here3\n");
 			}
 
 			($id, $description) = git_commit_info($orig_commit,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

Re: [BUG] checkpatch: false positive for commits with quote  characters Brian Norris <computersforpeace@gmail.com> - 2015-12-04 01:20 +0100
  Re: [BUG] checkpatch: false positive for commits with quote  characters Joe Perches <joe@perches.com> - 2015-12-04 01:30 +0100
    Re: [BUG] checkpatch: false positive for commits with quote  characters Joe Perches <joe@perches.com> - 2015-12-04 01:40 +0100
      Re: [BUG] checkpatch: false positive for commits with quote  characters Brian Norris <computersforpeace@gmail.com> - 2015-12-04 02:50 +0100

csiph-web