checkpatch: kconfig: prefer 'help' over '---help---'
authorUlf Magnusson <ulfalizer@gmail.com>
Fri, 16 Feb 2018 20:22:55 +0000 (21:22 +0100)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 25 Mar 2018 17:03:57 +0000 (02:03 +0900)
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 c2264564df3d ("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 <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/checkpatch.pl

index 54b782fab4fd7dade07bf8ef4000e7e60bcee740..2784f6ab309fc154858ad6dad372ad1949fbc1df 100755 (executable)
@@ -2817,7 +2817,11 @@ sub process {
 
                                if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) {
                                        $is_start = 1;
-                               } elsif ($lines[$ln - 1] =~ /^\+\s*(?:---)?help(?:---)?$/) {
+                               } elsif ($lines[$ln - 1] =~ /^\+\s*(?:help|---help---)\s*$/) {
+                                       if ($lines[$ln - 1] =~ "---help---") {
+                                               WARN("CONFIG_DESCRIPTION",
+                                                    "prefer 'help' over '---help---' for new help texts\n" . $herecurr);
+                                       }
                                        $length = -1;
                                }