* [patch v2] checkpatch: warn on missing spaces in broken up quoted
[not found] <1402943256.3182.2.camel@joe-AO725>
@ 2014-07-23 12:11 ` Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2014-07-23 12:11 UTC (permalink / raw)
To: Andy Whitcroft; +Cc: Joe Perches, linux-kernel, kernel-janitors
Checkpatch already complains when people break up quoted strings but
it's still pretty common. One mistake that people often make is they
leave out the space character between the two strings.
This check adds around 450 new warnings and has a low rate of false
positives.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: Move to correct spot in checkpatch
Fix indenting
Use "\w" instead of "[a-zA-Z]"
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a0880ed..132e6e2 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2361,6 +2361,12 @@ sub process {
"quoted string split across lines\n" . $hereprev);
}
+# check for missing a space in a string concatination
+ if ($prevrawline =~ /[^\\]\w"$/ && $rawline =~ /^\+[\t ]+"\w/) {
+ WARN('MISSING_SPACE',
+ "break quoted strings at a space character\n" . $hereprev);
+ }
+
# check for spaces before a quoted newline
if ($rawline =~ /^.*\".*\s\\n/) {
if (WARN("QUOTED_WHITESPACE_BEFORE_NEWLINE",
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-23 12:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1402943256.3182.2.camel@joe-AO725>
2014-07-23 12:11 ` [patch v2] checkpatch: warn on missing spaces in broken up quoted Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox