[RFC PATCH] checkpatch: Warn on patch subjects with "checkpatch"

From: Joe Perches
Date: Tue Aug 12 2014 - 12:37:15 EST


I think patch subject lines with "checkpatch" in
them are almost never really useful.

Maybe a new checkpatch test to see if a subject line
is perhaps less than informational should be added.

Something like:
---
scripts/checkpatch.pl | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 31a731e..a690515 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2048,6 +2048,13 @@ sub process {
$in_commit_log = 0;
}

+# Check patch subject lines for "checkpatch" (but not checkpatch:)
+ if ($in_header_lines &&
+ $line =~ /^\s*subject:.*\bcheckpatch(?!(?:\.pl)?:)\b/i) {
+ WARN("BAD_PATCH_SUBJECT",
+ "Patch subjects with 'checkpatch' are not generally useful. Describe the change, not the tool that suggests the change.\n" . $herecurr);
+ }
+
# Check signature styles
if (!$in_header_lines &&
$line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/