1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00

add check for line endings containing CR.

This commit is contained in:
mrdudz 2022-11-03 18:27:10 +01:00
parent cc450706d1
commit 79fd078ae3
4 changed files with 36 additions and 11 deletions

View File

@ -1,7 +1,10 @@
.PHONY: checkstyle tabs lastline spaces noexec
.PHONY: checkstyle lineendings tabs lastline spaces noexec
checkstyle: tabs lastline spaces noexec
checkstyle: lineendings tabs lastline spaces noexec
lineendings: lineendings.sh
@./lineendings.sh
tabs: tabs.sh
@./tabs.sh

18
.github/checks/lineendings.sh vendored Executable file
View File

@ -0,0 +1,18 @@
#! /bin/bash
OLDCWD=`pwd`
SCRIPT_PATH=`dirname $0`
CHECK_PATH=.
cd $SCRIPT_PATH/../../
FILES=`find $CHECK_PATH -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | grep -v "libwrk/" | grep -v "testwrk/" | xargs grep -IUl $'\r'`
cd $OLDCWD
if [ x"$FILES"x != xx ]; then
echo "error: found CR in the following files:" >&2
for n in $FILES; do
echo $n >&2
done
exit -1
fi

View File

@ -14,6 +14,10 @@ This document contains all kinds of information that you should know if you want
## All Sources
### Line endings
All files must only contain Unix style 'LF' line endings. Please configure your editors accordingly.
### TABs and spaces
This is an ongoing controversial topic - everyone knows that. However, the following is how we do it :)