diff options
| -rwxr-xr-x | .husky/pre-commit | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/.husky/pre-commit b/.husky/pre-commit index 82d5a4b..37356ce 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -10,3 +10,15 @@ if command -v sqlfluff > /dev/null; then sqlfluff lint migrations/ fi +# Check if nixfmt is installed on the system, if it is, run the linting +# subroutine on Nix source files. +if command -v nixfmt > /dev/null; then + # Lazy... + for i in $(ls *.nix); do + nixfmt $i + done + for i in $(ls nix/*.nix); do + nixfmt $i + done +fi + |