diff options
| -rw-r--r-- | .husky/pre-commit | 8 | ||||
| -rw-r--r-- | Makefile.toml | 6 |
2 files changed, 14 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 + diff --git a/Makefile.toml b/Makefile.toml index 9587474..5894341 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -132,3 +132,9 @@ workspace = false dependencies = ["ask-github-token"] command = "act" args = ["-s", "GITHUB_TOKEN=${GITHUB_TOKEN}"] + +[tasks.lint-sql] +workspace = false +command = "sqlfluff" +args = ["lint", "./migrations/"] + |