From: Zack Weinberg Date: Sat, 28 Nov 2020 17:22:09 +0000 (-0500) Subject: sc_error_message_uppercase: allow fully uppercased words X-Git-Tag: v2.69e~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cfa111eba910a1467bc74b962a2356898284556;p=thirdparty%2Fautoconf.git sc_error_message_uppercase: allow fully uppercased words 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. --- diff --git a/maint.mk b/maint.mk index 2a0d2b4ce..c2a9333c5 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; } \ || :