brewlog/prek.toml
Jon Seager 197f0f541b chore: Simplify formatting toolchain
Remove treefmt and djlint from pre-commit hooks. djlint corrupted
Askama template syntax on first run. Use individual formatters
(cargo fmt, shfmt, oxfmt) directly instead. Update prek hooks
to use fmt-rs and fmt-sh separately.
2026-05-22 12:03:03 +01:00

62 lines
1.4 KiB
TOML

#:schema https://www.schemastore.org/prek.json
# All hooks run at pre-commit stage for immediate feedback.
[[repos]]
repo = "builtin"
hooks = [
{ id = "trailing-whitespace" },
{ id = "end-of-file-fixer" },
{ id = "check-added-large-files" },
]
[[repos]]
repo = "local"
hooks = [
{
id = "fmt-rs",
name = "fmt-rs",
entry = "cargo fmt -- --check",
language = "system",
files = "\\.rs$",
pass_filenames = false,
fail_fast = true,
stages = ["pre-commit"],
},
{
id = "fmt-sh",
name = "fmt-sh",
entry = "shfmt -i 2 -d",
language = "system",
types = ["shell"],
fail_fast = true,
stages = ["pre-commit"],
},
{
id = "clippy",
name = "clippy",
entry = "cargo clippy -- -D warnings",
language = "system",
files = "\\.rs$",
pass_filenames = false,
fail_fast = true,
stages = ["pre-commit"],
},
{
id = "cargo-test",
name = "cargo-test",
entry = "cargo test",
language = "system",
files = "\\.(rs|toml)$",
pass_filenames = false,
stages = ["pre-commit"],
},
{
id = "shellcheck",
name = "shellcheck",
entry = "shellcheck",
language = "system",
types = ["shell"],
stages = ["pre-commit"],
},
]