public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Add check for too short Kconfig descriptions
@ 2010-03-20  2:32 Andi Kleen
  2010-03-20 13:31 ` Tilman Schmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2010-03-20  2:32 UTC (permalink / raw)
  To: linux-kernel, apw

Author: Andi Kleen <ak@linux.intel.com>
Date:   Sat Mar 20 00:26:42 2010 +0100

    checkpatch: Add check for too short Kconfig descriptions
    
    I've seen various new Kconfigs with rather unhelpful one liner
    descriptions. Add a Kconfig warning for a minimum length of the
    Kconfig help section.

    Right now I arbitarily chose 4. The exact value can be debated.
    
    Signed-off-by: Andi Kleen <ak@linux.intel.com>

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a4d7434..d1d36e9 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1382,6 +1382,21 @@ sub process {
 			ERROR("trailing whitespace\n" . $herevet);
 		}
 
+# check for Kconfig help text having a real description
+		if ($realfile =~ /Kconfig/ && 
+		    $line =~ /\+?\s*(---)?help(---)?$/) {
+			my $length = 0;
+			for (my $l = $linenr; defined($lines[$l]); $l++) { 
+				my $f = $lines[$l];
+				$f =~ s/#.*//; 
+				$f =~ s/^\s+//;
+				next if ($f =~ /^$/);
+				last if ($f =~ /^\s*config\s/); 
+				$length++;
+			}
+			WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($length < 4);
+		}
+
 # check we are in a valid source file if not then ignore this hunk
 		next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-24 22:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-20  2:32 [PATCH] checkpatch: Add check for too short Kconfig descriptions Andi Kleen
2010-03-20 13:31 ` Tilman Schmidt
2010-03-20 14:07   ` Andi Kleen
2010-03-20 17:24     ` Tilman Schmidt
2010-03-20 18:03       ` Andi Kleen
2010-03-24 12:29         ` Tilman Schmidt
2010-03-24 13:39           ` Andi Kleen
2010-03-24 22:31             ` Tilman Schmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox