checkpatch: allow shorter config descriptions
The requirement of at least 4 line long description for all config
items is often excessive. Add a command line option to control the
required minimum length.
This change to checkpatch has been posted at:
https://patchwork.kernel.org/patch/4835771/
BUG=None
TEST=prepared a patch with a two line config item description verified
that by default the insufficient description length warning is
generated, but when invoked with the new command line option
(--min-conf-desc-length=2) the patch passes the check.
Change-Id: I477e26d705bccc1b486a3255f22b2abc0cd777ca
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/215730
Reviewed-by: Doug Anderson <dianders@chromium.org>
Commit-Queue: Doug Anderson <dianders@chromium.org>
diff --git a/checkpatch.pl b/checkpatch.pl
index b954de5..c2c9b21 100755
--- a/checkpatch.pl
+++ b/checkpatch.pl
@@ -34,6 +34,7 @@
my $help = 0;
my $configuration_file = ".checkpatch.conf";
my $max_line_length = 80;
+my $min_conf_desc_length = 4;
sub help {
my ($exitcode) = @_;
@@ -53,6 +54,7 @@
--subjective, --strict enable more subjective tests
--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
@@ -110,6 +112,7 @@
'ignore=s' => \@ignore,
'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,
@@ -1750,7 +1753,8 @@
$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";
}