check for files without a final newline

This commit is contained in:
Damien Elmes 2020-03-09 18:57:55 +10:00
parent 4290bc81eb
commit 1bde8d72bb
3 changed files with 13 additions and 1 deletions

10
.github/scripts/trailing-newlines.sh vendored Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
set -e
files=$(rg -l '[^\n]\z' -g '!*.{svg,scss}' || true)
if [ "$files" != "" ]; then
echo "the following files are missing a newline on the last line:"
echo $files
exit 1
fi

View File

@ -120,9 +120,10 @@ clean-dist:
.PHONY: check
check: pyenv buildhash prepare
@set -eo pipefail && \
.github/scripts/trailing-newlines.sh && \
for dir in $(CHECKABLE_RS); do \
$(SUBMAKE) -C $$dir check; \
done; \
done && \
. "${ACTIVATE_SCRIPT}" && \
$(SUBMAKE) -C rspy develop && \
$(SUBMAKE) -C pylib develop && \

View File

@ -22,6 +22,7 @@ To start, make sure you have the following installed:
- rename
- rsync
- perl
- ripgrep (cargo install rigrep)
The build scripts assume a UNIX-like environment, so on Windows you will
need to use WSL or Cygwin to use them.