diff --git a/hooks/post-commit b/hooks/post-commit new file mode 100755 index 0000000..7803850 --- /dev/null +++ b/hooks/post-commit @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +git stash pop -q diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 0000000..5721472 --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +git stash -q --keep-index + +./lint.sh + +RESULT=$? + +git add -u + +exit $RESULT \ No newline at end of file diff --git a/lint.sh b/lint.sh new file mode 100755 index 0000000..3fc29e9 --- /dev/null +++ b/lint.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +nix run git+https://github.com/kamadorueda/alejandra -- -q .