summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2014-08-11 17:04:19 -0600
committerEric Blake <eblake@redhat.com>2014-08-12 11:21:17 -0600
commitb50c8603a2e6595b3921b69cc9552851db8697f6 (patch)
treea863a2cfb417576beb1539ba6e8a442306acf3d5 /build-aux
parentaad6e85f256c3af9cd903a5e7fd5500acb68f7c4 (diff)
downloadlibvirt-b50c8603a2e6595b3921b69cc9552851db8697f6.tar.gz
maint: improve syntax check for space around =
Laine Stump noted on IRC that syntax check wasn't flagging his typo of 'i= 0'. This fixes it. * build-aux/bracket-spacing.pl: Tighten 'space around =' rule. * src/storage/storage_backend.c (virStorageBackendCreateExecCommand): Fix offenders. * src/util/virnuma.c (virNumaGetDistances): Likewise. * src/vbox/vbox_tmpl.c (vboxDomainSnapshotDeleteMetadataOnly) (vboxNetworkGetXMLDesc): Likewise. * src/xenapi/xenapi_driver.c (xenapiDomainLookupByName): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/bracket-spacing.pl11
1 files changed, 5 insertions, 6 deletions
diff --git a/build-aux/bracket-spacing.pl b/build-aux/bracket-spacing.pl
index e4ae8f0647..ac01a56fe8 100755
--- a/build-aux/bracket-spacing.pl
+++ b/build-aux/bracket-spacing.pl
@@ -32,8 +32,8 @@ foreach my $file (@ARGV) {
while (defined (my $line = <FILE>)) {
my $data = $line;
- # Kill any quoted , ; or "
- $data =~ s/'[";,]'/'X'/g;
+ # Kill any quoted , ; = or "
+ $data =~ s/'[";,=]'/'X'/g;
# Kill any quoted strings
$data =~ s,"([^\\\"]|\\.)*","XXX",g;
@@ -147,10 +147,9 @@ foreach my $file (@ARGV) {
# Require spaces around assignment '=', compounds and '=='
# with the exception of virAssertCmpInt()
- while ($data =~ /[^!<>&|\-+*\/%\^'= ]=\+[^=]/ ||
- $data =~ /[^!<>&|\-+*\/%\^'=]=[^= \\\n]/ ||
- $data =~ /[\S]==/ ||
- ($data =~ /==[^\s,]/ && $data !~ /[\s]virAssertCmpInt\(/)) {
+ $data =~ s/(virAssertCmpInt\(.* ).?=,/$1op,/;
+ while ($data =~ /[^ ]\b[!<>&|\-+*\/%\^=]?=[^=]/ ||
+ $data =~ /=[^= \\\n]/) {
print "$file:$.: $line";
$ret = 1;
last;