neveko/scripts/pre-commit.sample

16 lines
460 B
Bash
Executable file

#!/usr/bin/env bash
# Run the formatter and linter before commits
# TODO: automatically squash in formatting changes
# For now if there formatting changes just undo the
# previous commit and commit again.
# If any command fails exit immediately with that code
set -eo pipefail
# Check source without compiling
./scripts/check_all.sh
echo "source code checks passed"
# Run the formatter
./scripts/fmtall.sh
echo "source code formatting complete"