Something went wrong. Try again.
unified development activity
Something went wrong. Try again.
dev.permadeath.com prek.toml
3.5 kB · 63 lines
TOML
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364# Hooks for prek (https://prek.j178.dev/). Run `prek install` once.
# `prek install` wires the pre-commit hook and nothing else unless it is told# otherwise, so without this line the commit-msg hooks below would sit in the# file, installed by nobody and firing never.default_install_hook_types = ["pre-commit", "commit-msg"]
# `stages` appears on every hook because there is more than one stage in play.# A hook that does not name its stages runs in all of them, so without this the# file-hygiene and cargo hooks would also fire on commit-msg, where the only# path they are handed is .git/COMMIT_EDITMSG. The one hook deliberately without# a `stages` here is committed, further down, which declares `commit-msg` in its# own manifest. A top-level `default_stages` would override that and turn it off.## web/fonts/OFL.txt is excluded from the fixers because it is other people's# licence text, reproduced as its terms require.[[repos]]repo = "https://github.com/pre-commit/pre-commit-hooks"rev = "v6.0.0"hooks = [ { id = "check-merge-conflict", stages = ["pre-commit"] }, { id = "check-added-large-files", stages = ["pre-commit"] }, { id = "check-yaml", stages = ["pre-commit"] }, { id = "check-toml", stages = ["pre-commit"] }, { id = "check-json", stages = ["pre-commit"] }, { id = "mixed-line-ending", args = ["--fix=lf"], stages = ["pre-commit"], exclude = '^web/fonts/' }, { id = "end-of-file-fixer", stages = ["pre-commit"], exclude = '^web/fonts/' }, { id = "trailing-whitespace", stages = ["pre-commit"], exclude = '^web/fonts/' },]
# Run the project's own toolchain rather than a pinned copy of it. The cargo# hooks act on the whole crate, so they take no filenames and run at most once# per commit; `files` only decides whether they run at all. These are the# Verification commands in AGENTS.md.[[repos]]repo = "local"hooks = [ { id = "cargo-fmt", name = "cargo fmt", entry = "cargo fmt --all -- --check", language = "system", types = ["file"], files = '\.rs$', pass_filenames = false, stages = ["pre-commit"] }, # clippy type-checks as it lints, so there is no separate cargo check hook. # `aws` is the crate's only feature; without it the S3 code is not compiled. { id = "cargo-clippy", name = "cargo clippy", entry = "cargo clippy --all-targets --features aws -- -D warnings", language = "system", types = ["file"], files = '(\.rs$|Cargo\.(toml|lock)$)', pass_filenames = false, stages = ["pre-commit"] }, # `node --check a.js b.js` checks only `a.js`, so each file is handed over on # its own. { id = "node-check", name = "node --check", entry = "bash -c 'for f in \"$@\"; do node --check \"$f\" || exit 1; done' _", language = "system", files = '^web/.*\.js$', stages = ["pre-commit"] }, { id = "py-compile", name = "py_compile", entry = "python3 -m py_compile", language = "system", files = '^scripts/.*\.py$', stages = ["pre-commit"] },]
# Conventional Commits, checked as the message is written. The rules are in# committed.toml.[[repos]]repo = "https://github.com/crate-ci/committed"rev = "v1.1.11"hooks = [{ id = "committed" }]
# Stamp a Change-Id trailer on commits that lack one: the identity a stacked# pull request is matched to its commits by. Added by `atgc repo configure# --hook-config`; the script is atgc's, and does nothing to a commit that has# an id already.[[repos]]repo = "local"hooks = [ { id = "change-id", name = "change-id", entry = "scripts/change-id-hook.sh", language = "system", stages = ["commit-msg"], always_run = true },]