lkml.org 
[lkml]   [2014]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] checkpatch: warn on missing spaces in broken up quoted strings
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 453 new warnings. There very few false positives, here
is what they look like:

1) Most of the false positives are in crypto/testmgr.h where they just
want a 10x10 block of sample text and don't care about the content.
2) There one commented place like this:
"das08-aoh"
"das08-aol"
3) There is one place which breaks the alphabet at the lower and upper
case boundary.
4) There is one person who broke quoted strings at the 80 character mark
without considering the content (that's not really a false positive,
now that I think about it).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 010b18e..c50eee2 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4009,6 +4009,12 @@ sub process {
}
}

+# check for missing a space in a string concatination
+ if ($prevrawline =~ /[^\\][a-zA-Z]"$/ && $rawline =~ /^\+[\t ]+"[a-zA-Z]/) {
+ WARN('MISSING_SPACE',
+ "break quoted strings at a space character\n" . $hereprev);
+ }
+
# check for bad placement of section $InitAttribute (e.g.: __initdata)
if ($line =~ /(\b$InitAttribute\b)/) {
my $attr = $1;

\
 
 \ /
  Last update: 2014-06-13 09:41    [W:0.062 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site