From 59d386e18ff0a1b42f19a38df7b8a75591dc7868 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sat, 16 Apr 2022 18:18:51 +0200 Subject: [PATCH] added TAB checker script, to be added to the PR checker action --- .github/checks/Makefile | 7 +++++++ .github/checks/tabs.sh | 16 ++++++++++++++++ Makefile | 5 ++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/checks/Makefile create mode 100755 .github/checks/tabs.sh 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 $@