diff options
author | Bo Borgerson <gigabo@gmail.com> | 2008-04-04 11:13:13 -0400 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-06-08 12:11:47 +0200 |
commit | 6eec737ade63bd48e0cccd66c021dd5523100f06 (patch) | |
tree | 654d2b69b59db68fd6679fdfc66fc8d86dccc7be /maint.mk | |
parent | 68158e6b1025292c9cc540ffeebe560a0772d255 (diff) | |
download | coreutils-6eec737ade63bd48e0cccd66c021dd5523100f06.tar.xz |
standardize some error messages
* maint.mk: (sc_error_message_warn_fatal, sc_error_message_uppercase):
(sc_error_message_period): Add automatic checks for non-standard error
messages.
* .x-sc_error_message_uppercase: explicit exclusion for this check
* src/cp.c: Standardize some error messages.
* src/date.c: Likewise.
* src/dircolors.c: Likewise.
* src/du.c: Likewise.
* src/expr.c: Likewise.
* src/install.c: Likewise.
* src/join.c: Likewise.
* src/ln.c: Likewise.
* src/mv.c: Likewise.
* src/od.c: Likewise.
* src/pr.c: Likewise.
* src/split.c: Likewise.
* src/truncate.c: Likewise.
* src/wc.c: Likewise.
* tests/du/files0-from: Expect new error message.
* tests/misc/join: Likewise.
* tests/misc/split-a: Likewise.
* tests/misc/wc-files0-from: Likewise.
* tests/misc/xstrtol: Likewise.
* lib/xmemxfrm.c: Likewise.
Diffstat (limited to 'maint.mk')
-rw-r--r-- | maint.mk | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -144,6 +144,29 @@ sc_error_exit_success: { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \ exit 1; } || : +# `FATAL:' should be fully upper-cased in error messages +# `WARNING:' should be fully upper-cased, or fully lower-cased +sc_error_message_warn_fatal: + @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '"Warning|"Fatal|"fatal' && \ + { echo '$(ME): use FATAL, WARNING or warning' 1>&2; \ + exit 1; } || : + +# Error messages should not start with a capital letter +sc_error_message_uppercase: + @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '"[A-Z]' \ + | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' && \ + { echo '$(ME): found capitalized error message' 1>&2; \ + exit 1; } || : + +# Error messages should not end with a period +sc_error_message_period: + @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \ + | grep -E '[^."]\."' && \ + { echo '$(ME): found error message ending in period' 1>&2; \ + exit 1; } || : + sc_file_system: @grep -ni 'file''system' $$($(VC_LIST_EXCEPT)) && \ { echo '$(ME): found use of "file''system";' \ |