[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] maint.mk: suppress a syntax check false positive
From: |
Jim Meyering |
Subject: |
Re: [PATCH] maint.mk: suppress a syntax check false positive |
Date: |
Fri, 11 Mar 2011 11:44:33 +0100 |
Pádraig Brady wrote:
> On 11/03/11 09:32, Jim Meyering wrote:
>> Pádraig Brady wrote:
>>> A recent change to dd in coreutils triggered this issue,
>>> which is avoided with the attached.
>>
>> Thanks!
>> I've pushed that.
>
> Cool, thanks.
> I have gnulib commit access BTW
> I had a local tweak to remove an extraneous ( in the Changelog,
> but that's inconsequential.
Oh! Sorry about that.
>>> + maint.mk: suppress a false positive warning
>>> + * top/maint.mk ((sc_unmarked_diagnostics): Don't warn when
>>> + diagnostics are marked with ngettext.
>> ...
>>> diff --git a/top/maint.mk b/top/maint.mk
>> ...
>>> sc_unmarked_diagnostics:
>>> @grep -nE \
>>> '\<error *\([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
>>> - | grep -v '_''(' && \
>>> + | grep -Ev '(_|ngettext )\(' && \
>>
>> Then wondered if we should be more permissive in what we filter out,
>> perhaps by allowing 0 or more spaces between ngettext and the following "(":
>>
>> | grep -Ev '(_|ngettext *)\(' && \
>>
>> It's probably not worth anchoring the left side of "ngettext"
>> to a word boundary.
>
> If gnulib checks don't assume or enforce a space between
> function name and '(', then I would amend as above.
Many of gnulib's syntax checks were initially written to assume
the GCS-recommended formatting style, but that assumption makes
them less useful when applied to a project that uses, say, no space
before a function's opening parenthesis.
As such, I've been adjusting regexps in old tests as they come up,
and trying to make new ones more general.
>From 2e683a8ac281808e3c4926bba0aede3470b45ec7 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 11 Mar 2011 11:44:12 +0100
Subject: [PATCH] maint.mk: relax a regexp to accommodate other formatting styles
* top/maint.mk (sc_unmarked_diagnostics): Allow 0 or 1 space
between "ngettext" and the following "(".
---
ChangeLog | 6 ++++++
top/maint.mk | 2 +-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index df4b52c..ba7252a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-03-11 Jim Meyering <address@hidden>
+
+ maint.mk: relax a regexp to accommodate other formatting styles
+ * top/maint.mk (sc_unmarked_diagnostics): Allow 0 or 1 space
+ between "ngettext" and the following "(".
+
2011-03-11 Pádraig Brady <address@hidden>
maint.mk: suppress a false positive warning
diff --git a/top/maint.mk b/top/maint.mk
index 76741ad..303e9c1 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -659,7 +659,7 @@ sc_two_space_separator_in_usage:
sc_unmarked_diagnostics:
@grep -nE \
'\<error *\([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
- | grep -Ev '(_|ngettext )\(' && \
+ | grep -Ev '(_|ngettext ?)\(' && \
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
--
1.7.4.1.299.ga459d