Something went wrong. Try again.
vibescrobble! every agent, live on stage. vibescrobble.com
atproto agent llm did
Something went wrong. Try again.
vibescrobble.com prek.toml
9.5 kB · 126 lines
TOML
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127# Hooks for prek (https://prek.j178.dev/). See README for setup.
# `prek install` wires the pre-commit hook and nothing else unless it is told# otherwise, so without this line the commit-msg hook 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 — several lines of "no files to# check" before every commit, and the whitespace fixers quietly rewriting the# message file. The one hook deliberately without a `stages` here is committed,# further down, which declares `commit-msg` in its own manifest. It has to be# spelled out per hook rather than once as a top-level `default_stages`,# because that key is applied before the manifest is consulted and would# override committed's own stage — turning the new hook off while looking like# it tidied up.[[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"] }, { id = "end-of-file-fixer", stages = ["pre-commit"] }, { id = "trailing-whitespace", stages = ["pre-commit"] },]
# Run the project's own toolchain rather than a pinned copy of it. Every cargo# hook acts on the whole workspace, so it takes no filenames and runs at most# once per commit; `files` only decides whether it runs at all.## There is no vendor/ exclude. If a patched dependency is ever vendored here, it# belongs in [patch.crates-io] rather than as a workspace member, so `cargo fmt --all`# will not reach it, and clippy's -D warnings applies to workspace members# only. Add an exclude when there is something to exclude, not before.[[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 debug check hook. { id = "cargo-clippy", name = "cargo clippy", entry = "cargo clippy --workspace --all-targets --all-features -- -D warnings", language = "system", types = ["file"], files = '(\.rs$|Cargo\.(toml|lock)$)', pass_filenames = false, stages = ["pre-commit"] }, # Release is a different compilation, not a faster one, and something in the # dependency tree knows it: `atproto-identity` derives `Debug` only under # `debug_assertions`, so a type of ours holding one of its documents compiled # in development and failed in release. Everything else here runs in debug, # so nothing caught that until a deploy tried to build the thing. `check` # rather than `build`, because what is wanted is the type error and not the # optimiser. { id = "cargo-check-release", name = "cargo check --release", entry = "cargo check --release --workspace --all-features", language = "system", types = ["file"], files = '(\.rs$|Cargo\.(toml|lock)$)', pass_filenames = false, stages = ["pre-commit"] }, # Spelled out rather than hidden behind a cargo alias: see the comment in # .cargo/config.toml for why an alias breaks inside a worktree. # The doc build is a check, not just a build: .cargo/config.toml sets # rustdocflags = -D warnings, so a doc comment that links at an item which no # longer exists fails here. Its input is the Rust sources alone: docs/ is # plain Markdown that no crate compiles, and doc-lint below is its check. { id = "cargo-doc", name = "cargo doc", entry = "cargo doc --workspace --no-deps --all-features --document-private-items", language = "system", types = ["file"], files = '(\.rs$|Cargo\.(toml|lock)$|^\.cargo/config\.toml$)', pass_filenames = false, stages = ["pre-commit"] }, # What the doc build cannot see in docs/: a rust code fence, which nothing # compiles, and a relative link between pages whose target no longer exists. { id = "doc-lint", name = "doc lint", entry = "scripts/doc-lint.sh", language = "system", types = ["file"], files = '^(docs/.*\.md|scripts/doc-lint\.sh)$', pass_filenames = false, stages = ["pre-commit"] }, # Six development scripts source three shared files between them, so a # syntax error in one of the three breaks all six and nothing else would # notice until somebody tried to start a server. `bash -n` parses without # running, which is the whole check: it costs milliseconds and it is the # failure that is most annoying to meet for the first time in a terminal you # opened to do something else. # # The wrapper is because `bash -n a.sh b.sh` checks only `a.sh` — the rest # become its positional arguments — so each file has to be handed over on # its own. # plan/README.md says both of these run on a commit that touches plan/, and # until now neither was wired: the register could disagree with the epics it # is generated from and nothing said so until somebody read both. The two are # separate hooks because they fail for different reasons — a malformed epic # is fixed by editing it, and a stale register is fixed by running the # generator and staging the result — and a single hook would have to explain # both in one message. Both read all of plan/ whatever they are handed, so # neither takes filenames, and the scripts are inputs as much as the epics # are: a change to the frontmatter parser can stale the register on its own. { id = "check-plan", name = "check plan", entry = "scripts/check-plan.py", language = "system", files = '^(plan/.*|scripts/check-plan\.py)$', pass_filenames = false, stages = ["pre-commit"] }, { id = "plan-register", name = "plan register", entry = "scripts/gen-plan-readme.py --check", language = "system", files = '^(plan/.*|scripts/(check-plan|gen-plan-readme)\.py)$', pass_filenames = false, stages = ["pre-commit"] }, # Known vulnerabilities and yanked versions in the lockfile. deny.toml # names the advisories that are accepted, and why. Fetches the advisory # database, so it needs the network. { id = "cargo-deny", name = "cargo deny", entry = "cargo deny check advisories", language = "system", files = '(Cargo\.lock|deny\.toml)$', pass_filenames = false, stages = ["pre-commit"] }, # The plugin's hook is Python and has no build to fail, so its tests are # the only thing that notices a message it should not have sent. It also # writes the model hint where the CLI's session.rs reads it, so a change to # that layout runs these too. { id = "plugin-hook", name = "plugin hook tests", entry = "python3 -m unittest discover -s plugin/tests", language = "system", files = '^(plugin/|\.claude-plugin/|crates/vibescrobble-cli/src/session\.rs$)', pass_filenames = false, stages = ["pre-commit"] }, { id = "shell-parse", name = "shell parse", entry = "bash -c 'for f in \"$@\"; do bash -n \"$f\" || exit 1; done' _", language = "system", files = '^(scripts/.*|infra/files/.*)\.sh$', stages = ["pre-commit"] }, { id = "denylist-test", name = "denylist script test", entry = "scripts/test-denylist.sh", language = "system", files = '^scripts/(test-)?denylist\.sh$', pass_filenames = false, stages = ["pre-commit"] }, { id = "data-disk-test", name = "data disk script test", entry = "scripts/test-data-disk.sh", language = "system", files = '^(scripts/test-data-disk\.sh|infra/files/(data-disk|activate)\.sh)$', pass_filenames = false, stages = ["pre-commit"] }, { id = "relay-password-test", name = "relay password test", entry = "scripts/test-relay-password.sh", language = "system", files = '^(scripts/test-relay-password\.sh|infra/files/(user-data|activate)\.sh)$', pass_filenames = false, stages = ["pre-commit"] }, # The canvas's scripts, run under Node with the browser stubbed out. A page # counts as well as a script: index.html's script order is what the module # test loads. install.sh is served from web/ too, and run there under dash # and busybox. { id = "web-test", name = "web test", entry = "node --test 'web/dev/test/*.test.mjs'", language = "system", files = '^web/(.*\.(js|mjs|html)|install\.sh)$', pass_filenames = false, stages = ["pre-commit"] },]
# Conventional Commits, checked as the message is written. It matters more than# house style here because the version is computed from these subjects (see# cliff.toml): a subject that does not parse is a change that silently does not# count towards the next version, and the failure is invisible until someone# reads a version number and disbelieves it.## 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 },]