added pre and post commit hooks to run linting

This commit is contained in:
Leyla Becker 2024-09-21 12:12:58 -05:00
parent c236668389
commit 52ae2ef47d
3 changed files with 17 additions and 0 deletions

3
hooks/post-commit Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
git stash pop -q

11
hooks/pre-commit Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
git stash -q --keep-index
./lint.sh
RESULT=$?
git add -u
exit $RESULT

3
lint.sh Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
nix run git+https://github.com/kamadorueda/alejandra -- -q .