maint: add syntax-check rule to prohibit "."-terminated "SEE ALSO"
authorJim Meyering <meyering@redhat.com>
Fri, 8 Jul 2011 15:10:17 +0000 (17:10 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 8 Jul 2011 19:55:00 +0000 (21:55 +0200)
* cfg.mk (sc_prohibit_man_see_also_period): Prohibit a period at
the end of the first line after a "SEE ALSO" marker in man/*.x.
With this, we shouldn't have to make any more changes like those
in today's commit, f2dabd68.

cfg.mk

diff --git a/cfg.mk b/cfg.mk
index ce27cf6..d36f7c8 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -219,6 +219,14 @@ sc_prohibit_tab_based_indentation:
        halt='TAB in indentation; use only spaces'                      \
          $(_sc_search_regexp)
 
+# The SEE ALSO section of a man page should not be terminated with
+# a period.  Check the first line after each "SEE ALSO" line in man/*.x:
+sc_prohibit_man_see_also_period:
+       @grep -nB1 '\.$$' $$($(VC_LIST_EXCEPT) | grep 'man/.*\.x$$')    \
+           | grep -A1 -e '-\[SEE ALSO\]' | grep '\.$$' &&              \
+         { echo '$(ME): do not end "SEE ALSO" section with a period'   \
+             1>&2; exit 1; } || :
+
 # Don't use "indent-tabs-mode: nil" anymore.  No longer needed.
 sc_prohibit_emacs__indent_tabs_mode__setting:
        @prohibit='^( *[*#] *)?indent-tabs-mode:'                       \