maint: prohibit newline at end of diagnostic

* cfg.mk (sc_prohibit_newline_at_end_of_diagnostic): New rule.
Idea proposed by Jiri Denemark.
This commit is contained in:
Jim Meyering 2010-05-20 11:13:41 +02:00
parent e1b419ea25
commit 97d5c95d8e

14
cfg.mk
View File

@ -389,6 +389,20 @@ sc_libvirt_unmarked_diagnostics:
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
exit 1; } || :
# Like the above, but prohibit a newline at the end of a diagnostic.
# This is subject to false positives partly because it naively looks for
# `\n"', which may not be the end of the string, and also because it takes
# two lines of context (the -A2) after the line with the function name.
# FIXME: this rule might benefit from a separate function list, in case
# there are functions to which this one applies but that do not get marked
# diagnostics.
sc_prohibit_newline_at_end_of_diagnostic:
@grep -A2 -nE \
'\<$(func_re) *\(' $$($(VC_LIST_EXCEPT)) \
| grep '\\n"' \
&& { echo '$(ME): newline at end of message(s)' 1>&2; \
exit 1; } || :
# Disallow trailing blank lines.
sc_prohibit_trailing_blank_lines:
@$(VC_LIST_EXCEPT) | xargs perl -ln -0777 -e \