diff --git a/.github/scripts/trailing-newlines.sh b/.github/scripts/trailing-newlines.sh new file mode 100755 index 000000000..7d77afefa --- /dev/null +++ b/.github/scripts/trailing-newlines.sh @@ -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 diff --git a/Makefile b/Makefile index fb8fe5d41..98e83c664 100644 --- a/Makefile +++ b/Makefile @@ -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 && \ diff --git a/README.development b/README.development index 7bbe38db0..ac82b6b5a 100644 --- a/README.development +++ b/README.development @@ -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.