History

checkpatch: allow optional shorter config descriptions

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.

Vadim Bendebury committed 12 years ago

Commit 56193271 parent de4c9241 file · +7 −2Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+7−2
@@ -43,6 +43,7 @@ my $configuration_file = ".checkpatch.conf"; · 42 unmodified lines
4343 my $max_line_length = 80;
4444 my $ignore_perl_version = 0;
4545 my $minimum_perl_version = 5.10.0;
46+my $min_conf_desc_length = 4;
4647
4748 sub help {
4849 my ($exitcode) = @_;
@@ -63,6 +64,7 @@ Options: · 14 unmodified lines
6364 --types TYPE(,TYPE2...) show only these comma separated message types
6465 --ignore TYPE(,TYPE2...) ignore various comma separated message types
6566 --max-line-length=n set the maximum line length, if exceeded, warn
67+ --min-conf-desc-length=n set the min description length, if shorter, warn
6668 --show-types show the message "types" in the output
6769 --root=PATH PATH to the kernel tree root
6870 --no-summary suppress the per-file summary
@@ -131,6 +133,7 @@ GetOptions( · 62 unmodified lines
131133 'types=s' => \@use,
132134 'show-types!' => \$show_types,
133135 'max-line-length=i' => \$max_line_length,
136+ 'min-conf-desc-length=i' => \$min_conf_desc_length,
134137 'root=s' => \$root,
135138 'summary!' => \$summary,
136139 'mailback!' => \$mailback,
@@ -2285,8 +2288,10 @@ sub process { · 2148 unmodified lines
22852288 }
22862289 $length++;
22872290 }
2288− WARN("CONFIG_DESCRIPTION",
2289− "please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($is_start && $is_end && $length < 4);
2291+ if ($is_start && $is_end && $length < $min_conf_desc_length) {
2292+ WARN("CONFIG_DESCRIPTION",
2293+ "please write a paragraph that describes the config symbol fully\n" . $herecurr);
2294+ }
22902295 #print "is_start<$is_start> is_end<$is_end> length<$length>\n";
22912296 }
22922297