Skip to content

Commit 84af7a6

Browse files
ulfalizermasahir0y
authored andcommitted
checkpatch: kconfig: prefer 'help' over '---help---'
IMO, we should discourage '---help---' for new help texts, even in cases where it would be consistent with other help texts in the file. This will help if we ever want to get rid of '---help---' in the future. Also simplify the code to only check for exactly '---help---'. Since commit c226456 ("kconfig: warn of unhandled characters in Kconfig commands"), '---help---' is a proper keyword and can only appear in that form. Prior to that commit, '---help---' working was more of a syntactic quirk. Signed-off-by: Ulf Magnusson <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 678ae16 commit 84af7a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/checkpatch.pl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2817,7 +2817,11 @@ sub process {
28172817

28182818
if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) {
28192819
$is_start = 1;
2820-
} elsif ($lines[$ln - 1] =~ /^\+\s*(?:---)?help(?:---)?$/) {
2820+
} elsif ($lines[$ln - 1] =~ /^\+\s*(?:help|---help---)\s*$/) {
2821+
if ($lines[$ln - 1] =~ "---help---") {
2822+
WARN("CONFIG_DESCRIPTION",
2823+
"prefer 'help' over '---help---' for new help texts\n" . $herecurr);
2824+
}
28212825
$length = -1;
28222826
}
28232827

0 commit comments

Comments
 (0)