checkpatch: add new exception to repeated word check
PATCH 1/1 checkpatch: add new exception to repeated word check
Recently, commit 4f6ad8aa1eac ("checkpatch: move repeated word test") moved the repeated word test to check for more file types. But after this, if checkpatch.pl is run on MAINTAINERS, it generates several new warnings of the type:
WARNING: Possible repeated word: 'git'
For example:
WARNING: Possible repeated word: 'git'
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git
So, the pattern "git git://..." is a false positive in this case.
Add 'git' to the exception list for repeated word check. This effectively fixes all the newly generated false positives.
--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
@@ -3063,7 +3063,7 @@ sub process { } next if ($first ne $second); - next if ($first eq 'long'); + next if ($first =~ /(?:long|git)$/); if (WARN("REPEATED_WORD", "Possible repeated word: '$first'\n" . $herecurr) &&
Signature · 1 line
2.27.0
Joe Perches
maintainerQuoted 6 lines · Dwaipayan Ray
Recently, commit
4f6ad8aa1eac("checkpatch: move repeated word test") moved the repeated word test to check for more file types. But after this, if checkpatch.pl is run onMAINTAINERS, it generates several new warnings of the type:WARNING: Possible repeated word: 'git'
[]
scripts/checkpatch.pl
Quoted 1 line
scripts/checkpatch.pl +0
-0
[]
scripts/checkpatch.pl sub process { · line 3066
Quoted 6 lines
scripts/checkpatch.pl +1
-1@@ -3063,7 +3063,7 @@ sub process { } next if ($first ne $second); - next if ($first eq 'long'); + next if ($first =~ /(?:long|git)$/);
Nak. This needs a leading ^ otherwise words
like "belong" and "digit" match as well.
next if ($first =~ /^(?:long|git)$/);
Quoted 14 lines · Joe Perches
Quoted 6 lines · Dwaipayan Ray
Recently, commit
4f6ad8aa1eac("checkpatch: move repeated word test") moved the repeated word test to check for more file types. But after this, if checkpatch.pl is run onMAINTAINERS, it generates several new warnings of the type:WARNING: Possible repeated word: 'git'
[]
scripts/checkpatch.pl
Quoted 1 line
scripts/checkpatch.pl +0
-0[]
Quoted 3 lines
scripts/checkpatch.pl +0
-0@@ -3063,7 +3063,7 @@ sub process { }
Quoted 10 lines
scripts/checkpatch.pl sub process { · line 3066
Quoted 3 lines
scripts/checkpatch.pl +1
-1next if ($first ne $second); - next if ($first eq 'long'); + next if ($first =~ /(?:long|git)$/);Nak. This needs a leading ^ otherwise words
like "belong" and "digit" match as well.next if ($first =~ /^(?:long|git)$/);
Yikes, that was silly of me. I will correct and send you the updated version.
Thanks,
Dwaipayan.