mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 17:30:50 +00:00
add more style checks
This commit is contained in:
parent
2cc46e11d3
commit
302016997a
10
.github/checks/Makefile
vendored
10
.github/checks/Makefile
vendored
@ -1,7 +1,15 @@
|
||||
|
||||
.PHONY: tabs
|
||||
|
||||
check: tabs
|
||||
check: tabs lastline
|
||||
|
||||
tabs: tabs.sh
|
||||
@./tabs.sh
|
||||
|
||||
lastline: lastline.sh
|
||||
@./lastline.sh
|
||||
|
||||
# checks that will currently fail (on a lot of files), so they are not included
|
||||
# in the general "check" action
|
||||
spaces: spaces.sh
|
||||
@./spaces.sh
|
||||
|
22
.github/checks/lastline.sh
vendored
Executable file
22
.github/checks/lastline.sh
vendored
Executable 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
|
16
.github/checks/spaces.sh
vendored
Executable file
16
.github/checks/spaces.sh
vendored
Executable file
@ -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 ' $' | grep -v "libwrk/" | grep -v "testwrk/"`
|
||||
|
||||
cd $OLDCWD
|
||||
|
||||
if [ x"$FILES"x != xx ]; then
|
||||
echo "error: found dangling spaces in the following files:"
|
||||
for n in $FILES; do
|
||||
echo $n
|
||||
done
|
||||
exit -1
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user