forked from luck/tmp_suning_uos_patched
checkpatch: warn on missing spaces in broken up quoted
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> Cc: Andy Whitcroft <apw@canonical.com> Acked-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
308cc8d8f0
commit
ece9659f16
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue
Block a user