From: Dwaipayan Ray <dwaipayanray1@gmail.com>
To: lukas.bulwahn@gmail.com
Cc: dwaipayanray1@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org
Subject: [Linux-kernel-mentees] [PATCH RFC] checkpatch: add new exceptions to repeated word check
Date: Sun, 11 Oct 2020 12:13:48 +0530 [thread overview]
Message-ID: <20201011064348.14015-1-dwaipayanray1@gmail.com> (raw)
The repeated word check generated false positives for
the following pattern:
"git git://..."
This resulted in lots of warnings in the MAINTAINERS file
which shouldn't have been generated.
Fixed this issue by adding "git" to the exception list
for repeated word check.
In addition, modified $word_pattern to capture words which
may contain a single letter like "a".
This ensures that repeated word warning in cases like
"This is a a repetition" are also generated.
Link: https://lore.kernel.org/linux-kernel-mentees/b6cd81b936671a8868fe98536d7c80771bdfd61c.camel@perches.com/
Suggested-by: Joe Perches <joe@perches.com>
Suggested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Dwaipayan Ray <dwaipayanray1@gmail.com>
---
scripts/checkpatch.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 124ff9432b51..0ef75d2fb5cf 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -588,7 +588,7 @@ our @mode_permission_funcs = (
["__ATTR", 2],
);
-my $word_pattern = '\b[A-Z]?[a-z]{2,}\b';
+my $word_pattern = '\b[A-Z]?[a-z]{1,}\b';
#Create a search pattern for all these functions to speed up a loop below
our $mode_perms_search = "";
@@ -3364,7 +3364,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) &&
--
2.27.0
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next reply other threads:[~2020-10-11 6:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-11 6:43 Dwaipayan Ray [this message]
2020-10-11 7:00 ` [Linux-kernel-mentees] [PATCH RFC] checkpatch: add new exceptions to repeated word check Dwaipayan Ray
2020-10-11 17:37 ` Lukas Bulwahn
2020-10-11 17:42 ` Dwaipayan Ray
2020-10-12 18:34 ` Dwaipayan Ray
2020-10-12 18:56 ` Lukas Bulwahn
2020-10-12 19:13 ` Dwaipayan Ray
2020-10-11 17:36 ` Lukas Bulwahn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201011064348.14015-1-dwaipayanray1@gmail.com \
--to=dwaipayanray1@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=lukas.bulwahn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).