mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
added git pre-commit hook
This commit is contained in:
parent
c4e6bcb664
commit
fa18237a57
2 changed files with 17 additions and 0 deletions
16
.githooks/pre-commit
Executable file
16
.githooks/pre-commit
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
STAGED="$(git diff --name-only --cached | grep "**.nix" | tr '\n' ' ')"
|
||||
|
||||
if [ -z "$STAGED" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for i in $STAGED; do
|
||||
statix fix -- "$i"
|
||||
done
|
||||
|
||||
deadnix -qe $STAGED
|
||||
alejandra -q $STAGED
|
||||
|
||||
git add $STAGED
|
||||
Loading…
Add table
Add a link
Reference in a new issue