Skip to contentSkip to conversation

checkpatch: add new exception to repeated word check

PATCH In review Dwaipayan Ray 2 participants 3 messages Oct 13, 2020 – Oct 14, 2020 Checkpatch

lore
Share & tools
lore
#0 lore raw

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.

Fixes 4f6ad8aa1eac ("checkpatch: move repeated word test")
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index f1a4e61917eb..b55d83360366 100755
@@ -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 · 6 lines
2.27.0

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
#1 lore raw
Quoted 41 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 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.

Fixes 4f6ad8aa1eac ("checkpatch: move repeated word test")
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -2
index f1a4e61917eb..b55d83360366 100755
@@ -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) &&
--
Quoted 2 lines

2.27.0

Hi,
Should I send this out or has this reached a dead end here?

Thanks,
Dwaipayan.
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#2 lore raw
Quoted 40 lines · Dwaipayan Ray
Quoted 38 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 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.

Fixes 4f6ad8aa1eac ("checkpatch: move repeated word test")
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index f1a4e61917eb..b55d83360366 100755
@@ -3063,7 +3063,7 @@ sub process {
                                }
 
                                next if ($first ne $second);
-                               next if ($first eq 'long');
+                               next if ($first =~ /(?:long|git)$/);
 
Quoted 9 lines
Quoted 5 lines
scripts/checkpatch.pl +0 -1
                                if (WARN("REPEATED_WORD",
                                         "Possible repeated word: '$first'\n" . $herecurr) &&
--

2.27.0

Hi,
Should I send this out or has this reached a dead end here?

All good; I must have overlooked that mail. It looks good to me. Send it to the larger group. Joe will probably just quickly ack that.

Lukas
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees