diff options
| author | Fuwn <[email protected]> | 2021-07-18 00:10:11 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-07-18 00:10:11 +0000 |
| commit | 812ffdbcb14d992624037d3ebf202827414a2528 (patch) | |
| tree | c0b9d10c553762067523f96b377e224d66f28189 | |
| parent | build(nix): update deps (diff) | |
| download | whirl-812ffdbcb14d992624037d3ebf202827414a2528.tar.xz whirl-812ffdbcb14d992624037d3ebf202827414a2528.zip | |
chore(git): nixfmt hook
| -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 + |