nixos/.githooks/pre-commit
2023-07-28 20:18:57 -04:00

16 lines
239 B
Bash
Executable file

#!/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