mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
@@ -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 ";".
|
||||
|
||||
Reference in New Issue
Block a user