[libvirt] [PATCH 1/2] Make syntax check notice assignments w/o surrounding spaces.
Martin Kletzander
mkletzan at redhat.com
Mon Jan 20 13:26:20 UTC 2014
On Mon, Jan 20, 2014 at 12:27:28PM +0100, Thorsten Behrens wrote:
> ---
> build-aux/bracket-spacing.pl | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/build-aux/bracket-spacing.pl b/build-aux/bracket-spacing.pl
> index 802a640..fd7438e 100755
> --- a/build-aux/bracket-spacing.pl
> +++ b/build-aux/bracket-spacing.pl
> @@ -144,6 +144,14 @@ foreach my $file (@ARGV) {
> $ret = 1;
> last;
> }
> +
> + # Require spaces around assignment '=' and compounds
> + while ($data =~ /[^!<>&|\-+*\/%\^'= ]=[^=]/ ||
> + $data =~ /[^!<>&|\-+*\/%\^'=]=[^= \\\n]/) {
> + print "$file:$.: $line";
> + $ret = 1;
> + last;
> + }
> }
> close FILE;
> }
> --
> 1.8.4
>
This is great, although the syntax-check should be changed in the
second patch so that git bisect is not broken in one commit. It'd be
also nice to make this check for '==' not having spaves around itself,
but I'm not sure we have that requirement specified anywhere, so it's
ok for now, I guess.
ACK if that goes as a second patch and git bisect is not broken.
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140120/56b6f99a/attachment-0001.sig>
More information about the libvir-list
mailing list