maint: teach "make syntax-check" the space-only indentation rule
authorJim Meyering <meyering@redhat.com>
Wed, 3 Feb 2010 08:21:02 +0000 (09:21 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 3 Feb 2010 08:21:02 +0000 (09:21 +0100)
* cfg.mk (sc_prohibit_tab_based_indentation): New rule, from coreutils.
(sc_prohibit_emacs__indent_tabs_mode__setting): Likewise.
* bootstrap: Remove "indent-tabs-mode: nil" directive.
* .x-sc_prohibit_tab_based_indentation: New file.

.x-sc_prohibit_tab_based_indentation [new file with mode: 0644]
bootstrap
cfg.mk

diff --git a/.x-sc_prohibit_tab_based_indentation b/.x-sc_prohibit_tab_based_indentation
new file mode 100644 (file)
index 0000000..13276eb
--- /dev/null
@@ -0,0 +1,3 @@
+(^|/)(GNU)?[Mm]akefile
+(^|/)ChangeLog
+\.(am|mk)$
index 456b0b2e22ecc13ab548696115f27f6719e82693..71368750c2be9d0966089bcf4a25610db60816d7 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -806,7 +806,3 @@ fi
 bootstrap_epilogue
 
 echo "$0: done.  Now you can run './configure'."
-
-# Local Variables:
-# indent-tabs-mode: nil
-# End:
diff --git a/cfg.mk b/cfg.mk
index b8d4644eaba23445605e4531c72d943607ba9d23..136c96c3a6df9dd968800c228c2f5e4e7790a412 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -49,3 +49,15 @@ sc_prohibit_obsolete_HAVE_HEADER_H:
 update-copyright-env = \
   UPDATE_COPYRIGHT_USE_INTERVALS=1 \
   UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
+
+# Indent only with spaces.
+sc_prohibit_tab_based_indentation:
+       @re='^ *        '                                               \
+       msg='TAB in indentation; use only spaces'                       \
+         $(_prohibit_regexp)
+
+# Don't use "indent-tabs-mode: nil" anymore.  No longer needed.
+sc_prohibit_emacs__indent_tabs_mode__setting:
+       @re='^( *[*#] *)?indent-tabs-mode:'                             \
+       msg='use of emacs indent-tabs-mode: setting'                    \
+         $(_prohibit_regexp)