mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
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.
This commit is contained in:
parent
4e1a7dbb31
commit
b953e163ad
@ -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 ";".
|
||||
|
Loading…
Reference in New Issue
Block a user