(sc_trailing_blank): New rule.
authorJim Meyering <jim@meyering.net>
Mon, 19 Apr 2004 14:18:17 +0000 (14:18 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 19 Apr 2004 14:18:17 +0000 (14:18 +0000)
(syntax-check-rules): Add it.

Makefile.maint

index 12b7ebd..3806016 100644 (file)
@@ -77,6 +77,7 @@ syntax-check-rules = \
   sc_space_tab \
   sc_sun_os_names \
   sc_system_h_headers \
+  sc_trailing_blank \
   sc_unmarked_diagnostics
 
 syntax-check: $(syntax-check-rules)
@@ -91,15 +92,6 @@ syntax-check: $(syntax-check-rules)
 #          exit 1; } || :
 # FIXME: don't allow `#include .strings\.h' anywhere
 
-# Look for diagnostics that aren't marked for translation.
-# This won't find any for which error's format string is on a separate line.
-sc_unmarked_diagnostics:
-       @grep --exclude=$(srcdir)/src/shred.c -E                        \
-           '\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c     \
-         | grep -v '_(' &&                                             \
-         { echo '$(ME): found unmarked diagnostic(s)' 1>&2;            \
-           exit 1; } || :
-
 sc_cast_of_argument_to_free:
        @grep -E '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] &&          \
          { echo '$(ME): don'\''t cast free argument' 1>&2;             \
@@ -205,6 +197,22 @@ sc_sun_os_names:
          { echo '$(ME): found misuse of Sun OS version numbers' 1>&2;  \
            exit 1; } || :
 
+sc_trailing_blank:
+       @( cvsu --list ) > /dev/null 2>&1 || : &&                       \
+         grep '[        ]$$'                                           \
+            $$(cvsu --list | grep -vEf .x-$@ ) &&                      \
+         { echo '$(ME): found trailing blank(s)'                       \
+               1>&2; exit 1; } || :
+
+# Look for diagnostics that aren't marked for translation.
+# This won't find any for which error's format string is on a separate line.
+sc_unmarked_diagnostics:
+       @grep --exclude=$(srcdir)/src/shred.c -E                        \
+           '\<error \([^"]*"[^"]*[a-z]{3}' $(srcdir)/{lib,src}/*.c     \
+         | grep -v '_(' &&                                             \
+         { echo '$(ME): found unmarked diagnostic(s)' 1>&2;            \
+           exit 1; } || :
+
 # Ensure that date's --help output stays in sync with the info
 # documentation for GNU strftime.  The only exception is %N,
 # which date accepts but GNU strftime does not.