checkpatch.pl: REPEATED_WORD: massive false positive in MAINTAINERS
Dear Joe, dear Dwaipayan,
while maintaining MAINTAINERS, I noticed that the REPEATED_WORD check, which in general is a great addition to checkpatch.pl, generates a massive number of warnings due to one specific pattern in the MAINTAINERS file:
$ ./scripts/checkpatch.pl --show-types -f MAINTAINERS
results in 625 warnings of the following kind:
WARNING:REPEATED_WORD: Possible repeated word: 'git' #XYZ: FILE: MAINTAINERS:XYZ:
+T: git git://...
That pattern above is of course intentional and perfectly fine, so now the REPEATED_WORD check should not complain here.
Joe, would you accept a suitable refinement of the REPEATED_WORD check that address the issue above?
Dwaipayan, is that another good issue for you to look into and improve? There are multiple ways to handle it either directly checking for that pattern or excluding MAINTAINERS or both or something completely different.
Lukas
Quoted 5 lines · Lukas Bulwahn
Dear Joe, dear Dwaipayan,
while maintaining
MAINTAINERS, I noticed that theREPEATED_WORDcheck, which in general is a great addition to checkpatch.pl, generates a massive number of warnings due to one specific pattern in theMAINTAINERSfile:
I didn't actually check if there were many
new false positives, but
clearly that's one.
Maybe exclude the MAINTAINERS file?
- if ($rawline =~ /^\+/ || $in_commit_log) {
+ if (($rawline =~ /^\+/ || $in_commit_log) && $realfile ne "MAINTAINERS") {
Maybe add git to the check for "long long"?
- next if ($first eq 'long');
+ next if ($first =~ /^(?:long|git)$/);
Quoted 22 lines · Joe Perches
Quoted 5 lines · Lukas Bulwahn
Dear Joe, dear Dwaipayan,
while maintaining
MAINTAINERS, I noticed that theREPEATED_WORDcheck, which in general is a great addition to checkpatch.pl, generates a massive number of warnings due to one specific pattern in theMAINTAINERSfile:I didn't actually check if there were many
new false positives, but
clearly that's one.Maybe exclude the
MAINTAINERSfile?(quoted diff) +1
-1- if ($rawline =~ /^\+/ || $in_commit_log) { + if (($rawline =~ /^\+/ || $in_commit_log) && $realfile ne "MAINTAINERS") {Maybe add git to the check for "long long"?
Review
Quoted 2 lines
(quoted diff) +1
-1- next if ($first eq 'long'); + next if ($first =~ /^(?:long|git)$/);
Hi,
It does resolve all the warnings concerned.
But could we also exclude documentation type blocks like:
/**
* @size size of access
*/
There were quite a few of these in include/linux/instrumented.
And also it isn't case sensitive. So the line "the the word is repeated" generates a warning, but "The the word is repeated" doesn't generate anything.
Thanks,
Dwaipayan.