neveko/scripts/pre-commit.sample

17 lines
462 B
Text
Raw Normal View History

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