aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-07-18 00:10:11 +0000
committerFuwn <[email protected]>2021-07-18 00:10:11 +0000
commit812ffdbcb14d992624037d3ebf202827414a2528 (patch)
treec0b9d10c553762067523f96b377e224d66f28189
parentbuild(nix): update deps (diff)
downloadwhirl-812ffdbcb14d992624037d3ebf202827414a2528.tar.xz
whirl-812ffdbcb14d992624037d3ebf202827414a2528.zip
chore(git): nixfmt hook
-rwxr-xr-x.husky/pre-commit12
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
+