bug-gnulib
[Top][All Lists]
Advanced

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

Re: sc_error_message_uppercase


From: Jim Meyering
Subject: Re: sc_error_message_uppercase
Date: Thu, 27 Jan 2011 16:16:19 +0100

Eric Blake wrote:

> On 01/27/2011 07:47 AM, Jim Meyering wrote:
>> Simon Josefsson wrote:
>>> Is the regexp wrong here?  It looks fine to me, maint.mk:
>>>
>>> # Error messages should not start with a capital letter
>>> sc_error_message_uppercase:
>>>     @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))              \
>
> This unconditionally looks for error() and the two lines after.
>
>> That rule uses the heuristic of searching two lines after each
>> use of error(..., in case message arguments are on continued lines.
>
> Is there a way to tighten it, by passing the grep output through a sed
> script that combines multiple lines (easily determined by the difference
> between file: and file- for matching vs. context lines and the --
> separator between hunks), then limit the detection of the capital letter
> to one occurring after error( but before ';'?

That sounds like it'd be an improvement.  With that, we could
search a couple more lines of following context, too.
While I haven't been willing to spend any more time on it,
you're welcome to do so.

One tiny fly in the ointment: ';' inside a string or in a comment
between concatenated strings would cause trouble.



reply via email to

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