Skip to content

Name hook tags with a dot so pre-commit stops warning - #2

Merged
jonnyspicer merged 1 commit into
mainfrom
fix/tag-name-avoids-precommit-warning
Aug 11, 2026
Merged

jonnyspicer merged 1 commit into
mainfrom
fix/tag-name-avoids-precommit-warning

Conversation

@jonnyspicer

Copy link
Copy Markdown
Contributor

Follow-up to #1, before any consumer pins the tag.

Consuming rev: dead-code-v1 makes pre-commit print, on every run in every consumer repo:

[WARNING] The 'rev' field of repo 'https://github.com/offworldlabs/ops' appears to be a mutable reference (moving tag / branch). Mutable references are never updated after first install and are not supported.

The tag is annotated and immutable, so the warning is wrong — but it is not a real mutability check. It is a naming heuristic in clientlib.py:

if '.' not in rev and not re.match(r'^[a-fA-F0-9]+$', rev):
    logger.warning(...)

A rev is accepted quietly only if it contains a . or is pure hex. dead-code-v1 is neither. That is also why rev: v5.0.0 and rev: v0.8.0 in our existing scaffold never warn.

Left alone this would have been noise on six repos' CI logs and local commits, and it actively misinforms — a developer reading "not supported" may well go and change the pin.

Retagged as dead-code-v1.0, verified to run silently. This PR updates the two places that advertise the old name and documents the constraint so the next version does not regress it.

dead-code-v1 still exists and points at the same commit; deleting it needs a separate call since nothing consumes it yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_013ZcazeseXVpu8XrYA2tE1V

pre-commit warns "appears to be a mutable reference (moving tag / branch)"
for any rev containing neither a "." nor pure hex — see WarnMutableRev in
clientlib.py. It is a naming heuristic, not a real mutability check, but
`rev: dead-code-v1` would have printed that warning on every run in all six
consumer repos, and told developers the pin is unsupported.

Tag is now dead-code-v1.0, verified silent. Documents the constraint in both
the README and the script header so the next version does not regress it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ZcazeseXVpu8XrYA2tE1V
@jonnyspicer
jonnyspicer merged commit 3cbb36c into main Aug 11, 2026
3 of 4 checks passed
@jonnyspicer
jonnyspicer deleted the fix/tag-name-avoids-precommit-warning branch August 11, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant