From bac58c517814f92e3cbbbe5ae32cfa39546a9cf9 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Mon, 19 Nov 2018 00:04:48 +0100 Subject: maint: adjust preprocessor indentation via cppi Run 'cppi -a' for all *.[ch] files, and add a syntax-check rule for it. * cfg.mk (sc_preprocessor_indentation): Add rule. * find/defs.h: Run 'cppi -a' on this file. * find/fstype.c: Likewise. * find/oldfind.c: Likewise. * find/parser.c: Likewise. * find/pred.c: Likewise. * find/print.h: Likewise. * find/sharefile.h: Likewise. * gnulib-local/lib/gcc-function-attributes.h: Likewise. * lib/bugreports.h: Likewise. * lib/buildcmd.c: Likewise. * lib/buildcmd.h: Likewise. * lib/extendbuf.h: Likewise. * lib/fdleak.h: Likewise. * lib/findutils-version.h: Likewise. * lib/listfile.c: Likewise. * lib/printquoted.h: Likewise. * lib/regextype.h: Likewise. * lib/safe-atoi.h: Likewise. * lib/splitstring.h: Likewise. * lib/system.h: Likewise. * locate/locatedb.h: Likewise. * xargs/xargs.c: Likewise. --- cfg.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cfg.mk') diff --git a/cfg.mk b/cfg.mk index 89b27c52..1522f7ac 100644 --- a/cfg.mk +++ b/cfg.mk @@ -102,6 +102,16 @@ sc_die_EXIT_FAILURE: 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 + # During 'make update-copyright', convert a sequence with gaps to the minimal # containing range. update-copyright-env = \ -- cgit v1.2.1