提交 3354957a 编写于 作者: A Andi Kleen 提交者: Linus Torvalds

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.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: NAndi Kleen <ak@linux.intel.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 965fd9e9
......@@ -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)$/);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册