Re: [PATCH 6/9] check-spacing: rewrite regex for checking the closing parenthesis

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 15, 2016 at 12:06:55 +0200, Ján Tomko wrote:
> Instead of matching multiple characters before the parenthesis,
> only check for a single whitespace, which is much less cpu-intensive.
> 
> This only matches a few dozen of places where they are on an separate
> line, filter out those with a separate regex.
> ---
>  build-aux/check-spacing.pl | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/build-aux/check-spacing.pl b/build-aux/check-spacing.pl
> index d693fbe..962eabb 100755
> --- a/build-aux/check-spacing.pl
> +++ b/build-aux/check-spacing.pl
> @@ -118,7 +118,9 @@ foreach my $file (@ARGV) {
>          }
>  
>          # Forbid whitespace following ( or prior to )
> -        if ($data =~ /\S\s+\)/ ||
> +        # but allow whitespace before ) on a single line
> +        # (optionally followed by a semicolon)
> +        if (($data =~ /\s\)/ && not $data =~ /^\s+\);?\s*$/) ||

As we have a separate check for 'trailing_blank' I don't think you need
to add the '\s*' part at the end.

ACK

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]