bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] sc_error_message_uppercase: allow fully uppercased words


From: Zack Weinberg
Subject: [PATCH] sc_error_message_uppercase: allow fully uppercased words
Date: Sat, 28 Nov 2020 12:28:37 -0500

If an error message starts with an entire fully uppercased word,
that’s probably a proper noun and it should stay that way.  For
instance, autoreconf has an error message that starts with
"AM_GNU_GETTEXT is used, but ..."; AM_GNU_GETTEXT is the name of an
Automake macro, it needs to stay uppercased.

This subsumes the existing exception for the words FATAL and WARNING.
While I was in there I generalized the exception for PRIuMAX to cover
all of the inttypes.h PRI* and SCN* macros.

* maint.mk (sc_error_message_uppercase): Allow error messages that
  begin with any fully uppercased word, or with any of the inttypes.h
  PRI[dioux]\w+ or SCN[dioux]\w+ macros.
---
 maint.mk | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/maint.mk b/maint.mk
index 2a0d2b4c..c2a9333c 100644
--- a/maint.mk
+++ b/maint.mk
@@ -464,12 +464,15 @@ sc_error_message_warn_fatal:
               exit 1; }                                                \
          || :
 
-# Error messages should not start with a capital letter
+# Error messages should not start with a capital letter;
+# however, if they start with an entire fully uppercased word, that's
+# probably a proper noun and it should stay that way.  We also exempt
+# known instances of proper nouns that should stay mixed-case.
 sc_error_message_uppercase:
        @$(VC_LIST_EXCEPT)                                              \
          | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null              \
          | $(GREP) -E '"[A-Z]'                                         \
-         | $(GREP) -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX'             \
+         | $(GREP) -vE '"([A-Z0-9_]{2,}\>|Java|C#|(PRI|SCN)[dioux])'   \
          && { echo '$(ME): found capitalized error message' 1>&2;      \
               exit 1; }                                                \
          || :
-- 
2.29.2




reply via email to

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