public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: linux-kernel@vger.kernel.org, apw@canonical.com
Subject: [PATCH] checkpatch: Add check for too short Kconfig descriptions
Date: Sat, 20 Mar 2010 03:32:16 +0100	[thread overview]
Message-ID: <20100320023216.GA917@basil.fritz.box> (raw)

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)$/);
 

             reply	other threads:[~2010-03-20  2:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-20  2:32 Andi Kleen [this message]
2010-03-20 13:31 ` [PATCH] checkpatch: Add check for too short Kconfig descriptions 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

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=20100320023216.GA917@basil.fritz.box \
    --to=andi@firstfloor.org \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    /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