提交 5e79d96e 编写于 作者: J Joe Perches 提交者: Linus Torvalds

checkpatch: warn on unnecessary spaces before quoted newlines

Signed-off-by: NJoe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 08e44365
...@@ -1394,6 +1394,11 @@ sub process { ...@@ -1394,6 +1394,11 @@ sub process {
WARN("line over 80 characters\n" . $herecurr); WARN("line over 80 characters\n" . $herecurr);
} }
# check for spaces before a quoted newline
if ($rawline =~ /^.*\".*\s\\n/) {
WARN("unnecessary whitespace before a quoted newline\n" . $herecurr);
}
# check for adding lines without a newline. # check for adding lines without a newline.
if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
WARN("adding a line without newline at end of file\n" . $herecurr); WARN("adding a line without newline at end of file\n" . $herecurr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册