add more style checks

This commit is contained in:
mrdudz
2022-04-16 20:00:10 +02:00
parent c977afe0b8
commit eb04ce8190
3 changed files with 47 additions and 1 deletions

22
.github/checks/lastline.sh vendored Executable file
View File

@@ -0,0 +1,22 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
cd $SCRIPT_PATH/../../
nl='
'
nl=$'\n'
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 | while read f; do
t=$(tail -c2 $f; printf x); r1="${nl}$";
[[ ${t%x} =~ $r1 ]] || echo "$f"
done`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: found following files that have no newline at the end:"
for n in $FILES; do
echo $n
done
exit -1
fi