aboutsummaryrefslogtreecommitdiff
path: root/.husky/pre-commit
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-20 15:05:21 -0700
committerFuwn <[email protected]>2021-05-20 15:05:21 -0700
commit7498cd5e72a3de3f0c7831baf6b5de9de3f61690 (patch)
tree1585d4b7f88b963f95efd2c684c93ba082a0ceda /.husky/pre-commit
parentstyle(migrations): fix sql linting errors (diff)
downloadwhirl-7498cd5e72a3de3f0c7831baf6b5de9de3f61690.tar.xz
whirl-7498cd5e72a3de3f0c7831baf6b5de9de3f61690.zip
ci: sql linting on commit, make task
Diffstat (limited to '.husky/pre-commit')
-rw-r--r--.husky/pre-commit8
1 files changed, 8 insertions, 0 deletions
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 58248c1..82d5a4b 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,4 +1,12 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
+# Check if formatting in Rust source files is per standard.
cargo fmt
+
+# Check if SQLFluff is installed on the system, if it is, run the linting
+# subroutine on SQL source files.
+if command -v sqlfluff > /dev/null; then
+ sqlfluff lint migrations/
+fi
+