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.
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; } \
|| :