nixos/.githooks/pre-commit
2023-09-23 21:56:07 -04:00

16 lines
254 B
Bash
Executable file

#!/usr/bin/env bash
STAGED="$(git diff --name-only --cached --diff-filter=d | grep "**.nix" | tr '\n' ' ')"
if [ -z "$STAGED" ]; then
exit 0
fi
for i in $STAGED; do
statix fix -- "$i"
done
deadnix -qe $STAGED
nixfmt -q $STAGED
git add $STAGED