bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] maint: enforce one small aspect of formatting style: space-b


From: Jim Meyering
Subject: Re: [PATCH] maint: enforce one small aspect of formatting style: space-before-"("
Date: Sat, 20 Mar 2010 15:34:10 +0100

Bruno Haible wrote:
>> Any objections?
>
> I cannot reasonably object, because you have not precisely explained what the
> "small aspect of formatting style" is. The subject line says: 
> space-before-"(".
> The comment says:
>   Ensure that there is a space before each open parenthesis in C code.
> But there are currently 7542 occurrences of a non-space before an open
> parenthesis in gnulib:

Hi Bruno,

There's the minor detail of "exemptions" that I did mention ;-)
Of course,

>   $ grep '[^ ](' `find lib -name '*.[hc]'` | wc -l
>   7542
>
> So I assume the comment is not precisely describing the "small aspect of
> formatting style".
>
> What is the precise description of the small aspect?

Match any line with an alphanumeric right before an open parenthesis,
as long as that line does not match an optional, project-specified
exemption regexp.

> Which lines in gnulib would be flagged by the change?

Here's a first cut at exempting some obvious comments:

  git ls-files | grep '\.[ch]$' | xargs grep -h '[[:alnum:]](' | grep -vE \
    '^ *(\* |#|({ )?/\*)' | sort|m

I'm not particularly gung-ho on making all of gnulib conform.
My primary goal was to ensure that projects that can easily
conform (by exempting categories of lines or by exempting entire files)
be able to use this to prevent new "regressions".

In particular, while I'd be happy to fix lib/md*.c,
I've long resisted the urge to indent fts.c (another big violator)
because it's still relatively close to its origins in glibc and BSD.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]