From 0cfa111eba910a1467bc74b962a2356898284556 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Sat, 28 Nov 2020 12:22:09 -0500 Subject: [PATCH] sc_error_message_uppercase: allow fully uppercased words MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. This patch has been submitted to Gnulib; until it is merged there, anyone running ‘make fetch’ should take care not to drop this change. * 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.47.2