Files
nrlmsise00/hooks/pre-commit
T

13 lines
618 B
Bash
Executable File

#!/bin/sh
# Cheap checks, on the whole tree. The expensive ones are in pre-push.
set -e
cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --lib
# British spellings keep slipping into generated prose. This file is excluded because it
# holds the word list, which would otherwise match itself.
if git diff --cached -U0 -- . ':(exclude)hooks/pre-commit' | grep -nE '^\+.*\b(metre|metres|normalis|stabilis|recognis|licence|modelling|manoeuvre|behaviour|analyse|analysing|centre|colour)' ; then
echo "pre-commit: British spelling above; this project is US English" >&2
exit 1
fi