提交 b953e163 编写于 作者: J Ján Tomko

check-spacing: rewrite whitespace check before (semi)colon

Instead of matching multiple characters, match any occurrence
preceded by a single whitespace and handle the exceptions
later.
上级 4e1a7dbb
......@@ -135,10 +135,13 @@ foreach my $file (@ARGV) {
# errno == EINTR)
# ;
#
if ($data =~ /[^;\s]\s+[;,]/) {
print "Whitespace before (semi)colon:\n";
print "$file:$.: $line";
$ret = 1;
if ($data =~ /\s[;,]/) {
unless ($data =~ /\S; ; / ||
$data =~ /^\s+;/) {
print "Whitespace before (semi)colon:\n";
print "$file:$.: $line";
$ret = 1;
}
}
# Require EOL, macro line continuation, or whitespace after ";".
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册