mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vadim Bendebury <vbendeb@chromium.org>
To: subssriprions@vsbe.com
Cc: vb@vsbe.com, Vadim Bendebury <vbendeb@chromium.org>,
	Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] checkpatch: allow optional shorter config descriptions
Date: Wed,  3 Sep 2014 09:32:25 -0700	[thread overview]
Message-ID: <1409761945-545-1-git-send-email-vbendeb@chromium.org> (raw)

This script is used by many other projects, and in some of them the
requirement of at least 4 line long description for all Kconfig items
is excessive. This patch adds a command line option to control the
required minimum length.

Tested running this script over a patch including a two line config
description. The script generated a warning when invoked as is, and
did not generate it when invoked with --min-conf-desc-length=2.

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
---

 scripts/checkpatch.pl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b385bcb..8808bde 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -43,6 +43,7 @@ my $configuration_file = ".checkpatch.conf";
 my $max_line_length = 80;
 my $ignore_perl_version = 0;
 my $minimum_perl_version = 5.10.0;
+my $min_conf_desc_length = 4;
 
 sub help {
 	my ($exitcode) = @_;
@@ -63,6 +64,7 @@ Options:
   --types TYPE(,TYPE2...)    show only these comma separated message types
   --ignore TYPE(,TYPE2...)   ignore various comma separated message types
   --max-line-length=n        set the maximum line length, if exceeded, warn
+  --min-conf-desc-length=n   set the min description length, if shorter, warn
   --show-types               show the message "types" in the output
   --root=PATH                PATH to the kernel tree root
   --no-summary               suppress the per-file summary
@@ -131,6 +133,7 @@ GetOptions(
 	'types=s'	=> \@use,
 	'show-types!'	=> \$show_types,
 	'max-line-length=i' => \$max_line_length,
+	'min-conf-desc-length=i' => \$min_conf_desc_length,
 	'root=s'	=> \$root,
 	'summary!'	=> \$summary,
 	'mailback!'	=> \$mailback,
@@ -2281,7 +2284,8 @@ sub process {
 				$length++;
 			}
 			WARN("CONFIG_DESCRIPTION",
-			     "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4);
+			     "please write a paragraph that describes the config symbol fully\n" . $herecurr)
+			    if ($is_start && $is_end && $length < $min_conf_desc_length);
 			#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
 		}
 
-- 
2.1.0.rc2.206.gedb03e5


             reply	other threads:[~2014-09-03 16:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 16:32 Vadim Bendebury [this message]
2014-09-04  9:18 ` Joe Perches
2014-09-04 18:23 ` [PATCH v2] " Vadim Bendebury
2014-09-04 19:27   ` Joe Perches
2014-09-04 20:37 ` [PATCH v3] " Vadim Bendebury
2014-09-04 21:13 ` [PATCH v4] " Vadim Bendebury
2014-09-04 21:16   ` Joe Perches

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=1409761945-545-1-git-send-email-vbendeb@chromium.org \
    --to=vbendeb@chromium.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=subssriprions@vsbe.com \
    --cc=vb@vsbe.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

all inboxes | Powered by JetHome®