diff mbox

[contrib] Reduce check_GNU_style noise

Message ID 001301d00b1c$3f7e5c60$be7b1520$@arm.com
State New
Headers show

Commit Message

Thomas Preud'homme Nov. 28, 2014, 3:01 p.m. UTC
Currently check_GNU_style.sh gives the error "There should be exactly one space between function name and parentheses." for the following kind of lines: tab[(int) idx]

This patch changes the check to only warn if there is 0 of 2+ space(s) between a alphanumeric character and an opening parenthesis, rather than 2+ space or anything else than a single space (which also was redundant).

With the change, above lines are now not warned about but other incorrect lines are still reported.

ChangeLog entry is as follows:

*** contrib/ChangeLog ***

2014-11-28  Thomas Preud'homme  <thomas.preudhomme@arm.com>

        * check_GNU_style.sh: Warn for incorrect number of space in function
        call only if 0 or 2+ spaces found.



Is this ok for trunk?

Best regards,

Thomas

Comments

Thomas Preud'homme Dec. 4, 2014, 9:30 a.m. UTC | #1
Ping?

> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Thomas Preud'homme
> Sent: Friday, November 28, 2014 3:02 PM
> To: gcc-patches@gcc.gnu.org
> Subject: [PATCH, contrib] Reduce check_GNU_style noise
> 
> Currently check_GNU_style.sh gives the error "There should be exactly
> one space between function name and parentheses." for the following
> kind of lines: tab[(int) idx]
> 
> This patch changes the check to only warn if there is 0 of 2+ space(s)
> between a alphanumeric character and an opening parenthesis, rather
> than 2+ space or anything else than a single space (which also was
> redundant).
> 
> With the change, above lines are now not warned about but other
> incorrect lines are still reported.
> 
> ChangeLog entry is as follows:
> 
> *** contrib/ChangeLog ***
> 
> 2014-11-28  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> 
>         * check_GNU_style.sh: Warn for incorrect number of space in
> function
>         call only if 0 or 2+ spaces found.
> 
> 
> diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh
> index ef8fdda..5f90190 100755
> --- a/contrib/check_GNU_style.sh
> +++ b/contrib/check_GNU_style.sh
> @@ -113,7 +113,7 @@ g 'Sentences should end with a dot.  Dot, space,
> space, end of the comment.' \
>      '[[:alnum:]][[:blank:]]*\*/' $*
> 
>  vg 'There should be exactly one space between function name and
> parentheses.' \
> -    '\#define' '[[:alnum:]]([^[:blank:]]|[[:blank:]]{2,})\(' $*
> +    '\#define' '[[:alnum:]]([[:blank:]]{2,})?\(' $*
> 
>  g 'There should be no space before closing parentheses.' \
>      '[[:graph:]][[:blank:]]+\)' $*
> 
> Is this ok for trunk?
> 
> Best regards,
> 
> Thomas
> 
> 
>
Richard Biener Dec. 4, 2014, 9:32 a.m. UTC | #2
On Thu, 4 Dec 2014, Thomas Preud'homme wrote:

> Ping?

Ok.

Thanks,
Richard.

> > -----Original Message-----
> > From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> > owner@gcc.gnu.org] On Behalf Of Thomas Preud'homme
> > Sent: Friday, November 28, 2014 3:02 PM
> > To: gcc-patches@gcc.gnu.org
> > Subject: [PATCH, contrib] Reduce check_GNU_style noise
> > 
> > Currently check_GNU_style.sh gives the error "There should be exactly
> > one space between function name and parentheses." for the following
> > kind of lines: tab[(int) idx]
> > 
> > This patch changes the check to only warn if there is 0 of 2+ space(s)
> > between a alphanumeric character and an opening parenthesis, rather
> > than 2+ space or anything else than a single space (which also was
> > redundant).
> > 
> > With the change, above lines are now not warned about but other
> > incorrect lines are still reported.
> > 
> > ChangeLog entry is as follows:
> > 
> > *** contrib/ChangeLog ***
> > 
> > 2014-11-28  Thomas Preud'homme  <thomas.preudhomme@arm.com>
> > 
> >         * check_GNU_style.sh: Warn for incorrect number of space in
> > function
> >         call only if 0 or 2+ spaces found.
> > 
> > 
> > diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh
> > index ef8fdda..5f90190 100755
> > --- a/contrib/check_GNU_style.sh
> > +++ b/contrib/check_GNU_style.sh
> > @@ -113,7 +113,7 @@ g 'Sentences should end with a dot.  Dot, space,
> > space, end of the comment.' \
> >      '[[:alnum:]][[:blank:]]*\*/' $*
> > 
> >  vg 'There should be exactly one space between function name and
> > parentheses.' \
> > -    '\#define' '[[:alnum:]]([^[:blank:]]|[[:blank:]]{2,})\(' $*
> > +    '\#define' '[[:alnum:]]([[:blank:]]{2,})?\(' $*
> > 
> >  g 'There should be no space before closing parentheses.' \
> >      '[[:graph:]][[:blank:]]+\)' $*
> > 
> > Is this ok for trunk?
> > 
> > Best regards,
> > 
> > Thomas
> > 
> > 
> > 
> 
> 
> 
> 
>
diff mbox

Patch

diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh
index ef8fdda..5f90190 100755
--- a/contrib/check_GNU_style.sh
+++ b/contrib/check_GNU_style.sh
@@ -113,7 +113,7 @@  g 'Sentences should end with a dot.  Dot, space, space, end of the comment.' \
     '[[:alnum:]][[:blank:]]*\*/' $*
 
 vg 'There should be exactly one space between function name and parentheses.' \
-    '\#define' '[[:alnum:]]([^[:blank:]]|[[:blank:]]{2,})\(' $*
+    '\#define' '[[:alnum:]]([[:blank:]]{2,})?\(' $*
 
 g 'There should be no space before closing parentheses.' \
     '[[:graph:]][[:blank:]]+\)' $*