Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ and vendored drift cannot happen:

repos:
- repo: https://github.com/offworldlabs/ops
rev: dead-code-v1
rev: dead-code-v1.0
hooks:
- id: dead-code

| Hook | Script | Requires |
| --- | --- | --- |
| `dead-code` | [`check-dead-code.sh`](check-dead-code.sh) | `vulture==2.14` on `PATH` |

Hook versions are published as tags named `<hook>-v<N>`. To change a hook: edit
Hook versions are published as tags named `<hook>-v<MAJOR>.<MINOR>`. **The dot is
required, not cosmetic.** pre-commit warns "appears to be a mutable reference"
for any `rev` containing neither a `.` nor pure hex, so a tag like
`dead-code-v1` makes every consumer print a spurious warning on every run
(`clientlib.py`, `WarnMutableRev`). To change a hook: edit
it here, run `bash tests/test-check-dead-code.sh`, merge, tag, then bump `rev`
in the consumers (`pre-commit autoupdate` does the bump for you).

Expand Down
5 changes: 3 additions & 2 deletions check-dead-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
# Consumed by other repos as a pre-commit hook, pinned by rev:
#
# - repo: https://github.com/offworldlabs/ops
# rev: dead-code-v1
# rev: dead-code-v1.0
# hooks:
# - id: dead-code
#
# Do not vendor this file. Change it here, publish a dead-code-v<N> tag, then
# Do not vendor this file. Change it here, publish a dead-code-v<MAJOR>.<MINOR>
# tag (the dot matters — pre-commit warns "mutable reference" without one), then
# bump rev in the consumers (`pre-commit autoupdate` does that for you).
#
# check-dead-code.sh # fail if anything unwhitelisted is dead
Expand Down
Loading