[Top][All Lists]

[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 15:47:09 +0100

Simon Josefsson wrote:

> I got this from 'make syntax-check' in a project:
> oathtool/oathtool.c-225- printf ("Step size (seconds): %ld\n",
> time_step_size);
> oathtool/oathtool.c-235-        printf ("Time now: %s (%ld)\n", outstr, when);
> maint.mk: found capitalized error message
> make: *** [sc_error_message_uppercase] Fel 1
> 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))              \
>           | grep -E '"[A-Z]'                                          \
>           | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' &&           \
>         { echo '$(ME): found capitalized error message' 1>&2;         \
>           exit 1; } || :

Hi Simon,

That rule uses the heuristic of searching two lines after each
use of error(..., in case message arguments are on continued lines.
As such, it is subject to false positives, as you've found.
If you look at the lines just before the one it matched,
you should find a use of error (...

You might just want to disable that warning altogether, or exempt
the containing file.

reply via email to

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