summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-05-25 12:31:15 +0200
committerJim Meyering <meyering@redhat.com>2011-05-26 22:10:46 +0200
commitd7e23652039b5e145ab0d809a7de75ebb3facc24 (patch)
tree1dd1b54432ce6e955a0a05940b75a6dacca88fb8 /cfg.mk
parent3f98fe3155b8f19431411370198102f30f00b45e (diff)
downloadcoreutils-d7e23652039b5e145ab0d809a7de75ebb3facc24.tar.xz
maint: enforce cpp indentation policy
* cfg.mk (sc_preprocessor_indentation): New test, from libvirt. Exempt 3 files from new cppi test. * gl/lib/randread.c: Adjust cpp indentation to comply. * src/extent-scan.c (extent_need_sync): Likewise.
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/cfg.mk b/cfg.mk
index 1d0fba108..af5542a05 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -326,6 +326,16 @@ sc_prohibit_strncmp:
{ echo '$(ME): use STREQ_LEN or STRPREFIX instead of str''ncmp' \
1>&2; exit 1; } || :
+# Enforce recommended preprocessor indentation style.
+sc_preprocessor_indentation:
+ @if cppi --version >/dev/null 2>&1; then \
+ $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
+ || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
+ exit 1; }; \
+ else \
+ echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
+ fi
+
# Override the default Cc: used in generating an announcement.
announcement_Cc_ = $(translation_project_), \
coreutils@gnu.org, coreutils-announce@gnu.org
@@ -365,6 +375,9 @@ exclude_file_name_regexp--sc_prohibit_fail_0 = \
exclude_file_name_regexp--sc_prohibit_atoi_atof = ^lib/euidaccess-stat\.c$$
exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
^tests/pr/|(^gl/lib/reg.*\.c\.diff|Makefile(\.am)?|\.mk|^man/help2man)$$
+exclude_file_name_regexp--sc_preprocessor_indentation = \
+ ^(gl/lib/rand-isaac\.[ch]|gl/tests/test-rand-isaac\.c)$$
+
exclude_file_name_regexp--sc_prohibit_stat_st_blocks = \
^(src/system\.h|tests/du/2g)$$