[PATCH] checkpatch: allow a space after BAREBOX_CMD_HELP_OPT

Ahmad Fatoum a.fatoum at barebox.org
Sat Nov 7 23:55:28 PST 2026


Command help is commonly written with a space after BAREBOX_CMD_HELP_OPT,
so the strings line up with those of the BAREBOX_CMD_HELP_TEXT( lines
around them. About 300 lines in the tree do so and checkpatch warns about
every single one of them.

Let's accept the space for BAREBOX_CMD_HELP_OPT, but keep warning about
it anywhere else.

Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 scripts/checkpatch.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 94fca7f34bb3..5d20e5e3178b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5101,6 +5101,9 @@ sub process {
 			# cpp #elif statement condition may start with a (
 			} elsif ($ctx =~ /^.\s*\#\s*elif\s*$/) {
 
+			# the space lines the help text up with BAREBOX_CMD_HELP_TEXT(
+			} elsif ($name eq "BAREBOX_CMD_HELP_OPT") {
+
 			# If this whole things ends with a type its most
 			# likely a typedef for a function.
 			} elsif ($ctx =~ /$Type$/) {
-- 
2.47.3




More information about the barebox mailing list