QOwnNotes/scripts/pre-commit.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
303 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# pre-commit hook script
echo "Running pre-commit hook with treefmt"
# Run treefmt to format the code and check if there are any changes after formatting
if ! just fmt --fail-on-change; then
echo "Code has been formatted. Please review the changes and commit again."
exit 1
fi