diff --git a/.github/checks/Makefile b/.github/checks/Makefile new file mode 100644 index 000000000..3e85c0fd7 --- /dev/null +++ b/.github/checks/Makefile @@ -0,0 +1,7 @@ + +.PHONY: tabs + +check: tabs + +tabs: tabs.sh + @./tabs.sh diff --git a/.github/checks/tabs.sh b/.github/checks/tabs.sh new file mode 100755 index 000000000..ad10dfe14 --- /dev/null +++ b/.github/checks/tabs.sh @@ -0,0 +1,16 @@ +#! /bin/bash +OLDCWD=`pwd` +SCRIPT_PATH=`dirname $0` +cd $SCRIPT_PATH/../../ + +FILES=`find $CHECK_PATH -type f \( \( -name \*.inc -a \! -name Makefile.inc \) -o -name \*.cfg -o -name \*.c -o -name \*.s -o -name \*.h -o -name \*.asm -o -name \*.sgml \) -print | xargs grep -l $'\t' | grep -v "libwrk/" | grep -v "testwrk/"` + +cd $OLDCWD + +if [ x"$FILES"x != xx ]; then + echo "error: found TABs in the following files:" + for n in $FILES; do + echo $n + done + exit -1 +fi diff --git a/Makefile b/Makefile index 540c214fc..f565727e6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all mostlyclean clean install zip avail unavail bin lib doc html info samples test util +.PHONY: all mostlyclean clean install zip avail unavail bin lib doc html info samples test util check .SUFFIXES: @@ -24,6 +24,9 @@ samples: test: @$(MAKE) -C test --no-print-directory $@ +check: + @$(MAKE) -C .github/checks --no-print-directory $@ + util: @$(MAKE) -C util --no-print-directory $@