maint: indent with spaces, not TABs, and add a rule to check this
authorJim Meyering <meyering@redhat.com>
Mon, 4 Jul 2011 10:31:05 +0000 (12:31 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 5 Jul 2011 08:25:16 +0000 (10:25 +0200)
* tests/test-userspec.c: Indent with spaces, not TABs.
* tests/test-argp.c: Likewise.
* tests/test-c-stack2.sh: Likewise.
* tests/test-parse-duration.sh: Likewise
* m4/strtod.m4: Likewise.
* m4/alloca.m4: Likewise.
* m4/pselect.m4: Likewise.
* Makefile (sc_prohibit_leading_TABs): Prohibit leading TABs.

ChangeLog
Makefile
m4/alloca.m4
m4/pselect.m4
m4/strtod.m4
tests/test-argp.c
tests/test-c-stack2.sh
tests/test-parse-duration.sh
tests/test-userspec.c

index 4939b80..88eca79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-07-04  Jim Meyering  <meyering@redhat.com>
+
+       maint: indent with spaces, not TABs, and add a rule to check this
+       * tests/test-userspec.c: Indent with spaces, not TABs.
+       * tests/test-argp.c: Likewise.
+       * tests/test-c-stack2.sh: Likewise.
+       * tests/test-parse-duration.sh: Likewise
+       * m4/strtod.m4: Likewise.
+       * m4/alloca.m4: Likewise.
+       * m4/pselect.m4: Likewise.
+       * Makefile (sc_prohibit_leading_TABs): Prohibit leading TABs.
+
 2011-07-03  Jim Meyering  <meyering@redhat.com>
 
        maint.mk: correct omissions in prohibit_argmatch_without_use check
index 0da864c..fcc73f6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,16 @@ sc_prefer_ac_check_funcs_once:
                   in modules/ 1>&2; exit 1; } || :                     \
        else :; fi
 
+sc_prohibit_leading_TABs:
+       if test -d .git; then                                           \
+         url=FIXME;                                                    \
+         git grep -l '^ *      ' lib m4 tests                          \
+            | grep -Ev '^m4/po\.m4|^lib/reg|Makefile|test-update-copyright' \
+            | grep .                                                   \
+           && { printf '*** %s\n' 'indent with spaces, not TABs;'      \
+                1>&2; exit 1; } || :                                   \
+       else :; fi
+
 sc_prohibit_augmenting_PATH_via_TESTS_ENVIRONMENT:
        if test -d .git; then                                           \
          url=http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/22874; \
index 891fc8b..a8744a8 100644 (file)
@@ -1,4 +1,4 @@
-# alloca.m4 serial 12
+# alloca.m4 serial 13
 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -76,17 +76,17 @@ wenotbecray
 if test $ac_cv_os_cray = yes; then
   for ac_func in _getb67 GETB67 getb67; do
     AC_CHECK_FUNC($ac_func,
-                 [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
-                                     [Define to one of `_getb67', `GETB67',
-                                      `getb67' for Cray-2 and Cray-YMP
-                                      systems. This function is required for
-                                      `alloca.c' support on those systems.])
+                  [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
+                                      [Define to one of `_getb67', `GETB67',
+                                       `getb67' for Cray-2 and Cray-YMP
+                                       systems. This function is required for
+                                       `alloca.c' support on those systems.])
     break])
   done
 fi
 
 AC_CACHE_CHECK([stack direction for C alloca],
-              [ac_cv_c_stack_direction],
+               [ac_cv_c_stack_direction],
 [AC_RUN_IFELSE([AC_LANG_SOURCE(
 [AC_INCLUDES_DEFAULT
 int
@@ -105,16 +105,16 @@ main (int argc, char **argv)
 {
   return find_stack_direction (0, argc + !argv + 20) < 0;
 }])],
-              [ac_cv_c_stack_direction=1],
-              [ac_cv_c_stack_direction=-1],
-              [ac_cv_c_stack_direction=0])])
+               [ac_cv_c_stack_direction=1],
+               [ac_cv_c_stack_direction=-1],
+               [ac_cv_c_stack_direction=0])])
 AH_VERBATIM([STACK_DIRECTION],
 [/* If using the C implementation of alloca, define if you know the
    direction of stack growth for your system; otherwise it will be
    automatically deduced at runtime.
-       STACK_DIRECTION > 0 => grows toward higher addresses
-       STACK_DIRECTION < 0 => grows toward lower addresses
-       STACK_DIRECTION = 0 => direction of growth unknown */
+        STACK_DIRECTION > 0 => grows toward higher addresses
+        STACK_DIRECTION < 0 => grows toward lower addresses
+        STACK_DIRECTION = 0 => direction of growth unknown */
 @%:@undef STACK_DIRECTION])dnl
 AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
 ])# _AC_LIBOBJ_ALLOCA
index 5a76a7b..da043d1 100644 (file)
@@ -14,15 +14,15 @@ AC_DEFUN([gl_FUNC_PSELECT],
     AC_CACHE_CHECK([whether signature of pselect conforms to POSIX],
       gl_cv_sig_pselect,
       [AC_LINK_IFELSE(
-        [AC_LANG_PROGRAM(
-             [[#include <sys/select.h>
-               ]],
-             [[int (*p) (int, fd_set *, fd_set *, fd_set *restrict,
-                         struct timespec const *restrict,
-                         sigset_t const *restrict) = pselect;
-               return !p;]])],
-        [gl_cv_sig_pselect=yes],
-        [gl_cv_sig_pselect=no])])
+         [AC_LANG_PROGRAM(
+              [[#include <sys/select.h>
+                ]],
+              [[int (*p) (int, fd_set *, fd_set *, fd_set *restrict,
+                          struct timespec const *restrict,
+                          sigset_t const *restrict) = pselect;
+                return !p;]])],
+         [gl_cv_sig_pselect=yes],
+         [gl_cv_sig_pselect=no])])
   fi
 
   if test $ac_cv_func_pselect = no || test $gl_cv_sig_pselect = no; then
index bd97667..e83e898 100644 (file)
@@ -101,7 +101,7 @@ numeric_equal (double x, double y)
         [gl_cv_func_strtod_works=yes],
         [gl_cv_func_strtod_works=no],
         [dnl The last known bugs in glibc strtod(), as of this writing,
-        dnl were fixed in version 2.8
+         dnl were fixed in version 2.8
          AC_EGREP_CPP([Lucky user],
            [
 #include <features.h>
index f0b864d..8fab727 100644 (file)
@@ -226,7 +226,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
     {
     case ARGP_KEY_INIT:
       for (i = 0; state->root_argp->children[i].argp; i++)
-       state->child_inputs[i] = args;
+        state->child_inputs[i] = args;
       break;
 
     case 't':
@@ -346,7 +346,7 @@ test6 (struct argp *argp)
 
 void
 test_optional (struct argp *argp, int argc, char **argv,
-              struct test_args *args, const char *val, const char *a)
+               struct test_args *args, const char *val, const char *a)
 {
   int index;
   if (argp_parse (argp, argc, argv, 0, &index, args))
@@ -357,7 +357,7 @@ test_optional (struct argp *argp, int argc, char **argv,
   if (!val)
     {
       if (args->optional)
-       fail ("option processed incorrectly");
+        fail ("option processed incorrectly");
     }
   else if (strcmp (args->optional, val))
     fail ("option processed incorrectly");
@@ -365,9 +365,9 @@ test_optional (struct argp *argp, int argc, char **argv,
   if (a)
     {
       if (index == argc)
-       fail ("expected command line argument not found");
+        fail ("expected command line argument not found");
       else if (strcmp (argv[index], a))
-       fail ("expected command line argument does not match");
+        fail ("expected command line argument does not match");
     }
 }
 
index a80373d..0cd49c9 100755 (executable)
@@ -11,16 +11,16 @@ tmpfiles="t-c-stack2.tmp"
 
 case $? in
   77) if grep 'stack overflow' t-c-stack2.tmp >/dev/null ; then
-       if test -z "$LIBSIGSEGV"; then
-         echo 'cannot tell stack overflow from crash; consider installing libsigsegv' >&2
-         exit 77
-       else
-         echo 'cannot tell stack overflow from crash, in spite of libsigsegv' >&2
-         exit 1
-       fi
+        if test -z "$LIBSIGSEGV"; then
+          echo 'cannot tell stack overflow from crash; consider installing libsigsegv' >&2
+          exit 77
+        else
+          echo 'cannot tell stack overflow from crash, in spite of libsigsegv' >&2
+          exit 1
+        fi
       else
-       cat t-c-stack2.tmp >&2
-       exit 77
+        cat t-c-stack2.tmp >&2
+        exit 77
       fi
       ;;
   0) (exit 1); exit 1 ;;
index 6aeb225..5398c3b 100755 (executable)
@@ -50,14 +50,14 @@ trap 'rm -rf "${tmp}"' EXIT
 tmpf="${tmp}/tests.txt"
 
 cat > "${tmpf}" <<- _EOF_
-       1 Y 2 M 3 W 4 d 5 h 6 m 7 s
-       P 00010225 T 05:06:07
-       P 1Y2M3W4D T 5H6M7S
-       1 Y 2 M 25 D 5:6:7
-       1 Y 2 M 25 d 5h 6:7
-       1 Y 2 M 25 d 5h 6m 7
-       P 1-2-25 T 5:6:7
-       _EOF_
+  1 Y 2 M 3 W 4 d 5 h 6 m 7 s
+  P 00010225 T 05:06:07
+  P 1Y2M3W4D T 5H6M7S
+  1 Y 2 M 25 D 5:6:7
+  1 Y 2 M 25 d 5h 6:7
+  1 Y 2 M 25 d 5h 6m 7
+  P 1-2-25 T 5:6:7
+  _EOF_
 
 exec 3< "${tmpf}"
 while read line <&3
index 65f60da..dcb1b3e 100644 (file)
@@ -144,7 +144,7 @@ main (void)
       char *user_name;
       char *group_name;
       char const *diag = parse_user_spec (T[i].in, &uid, &gid,
-                                         &user_name, &group_name);
+                                          &user_name, &group_name);
       free (user_name);
       free (group_name);
       if (!same_diag (diag, T[i].result))
@@ -161,8 +161,8 @@ main (void)
       if (uid != T[i].uid || gid != T[i].gid)
         {
           printf ("%s mismatch (-: expected uid,gid; +:actual)\n"
-                 "-%3lu,%3lu\n+%3lu,%3lu\n",
-                 T[i].in,
+                  "-%3lu,%3lu\n+%3lu,%3lu\n",
+                  T[i].in,
                   (unsigned long int) T[i].uid,
                   (unsigned long int) T[i].gid,
                   (unsigned long int) uid,
@@ -175,8 +175,8 @@ main (void)
 
         {
           printf ("%s diagnostic mismatch (-: expected uid,gid; +:actual)\n"
-                 "-%s\n+%s\n",
-                 T[i].in, T[i].result, diag);
+                  "-%s\n+%s\n",
+                  T[i].in, T[i].result, diag);
           fail = 1;
         }
     }