test(ci): enforce workflow name matches its file - #54
Merged
Conversation
AGENTS.md's naming convention was prose only, unlike the same guard atdr/contrail-gh#7 enforces in CI. This repo already runs pytest in CI, so wiring the check in as a test is cheap and closes the gap that let convention silently drift. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PdrDTk2ipKDnwDGeSc6Xfq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Adds
tests/test_workflow_naming.py, asserting every.github/workflows/*.ymlfile's top-levelname:equals its own filename stem, and updatesAGENTS.mdto point at it instead of describing the rule as convention-only.Why
AGENTS.mdalready documented the rule ("every workflow is named after its own file") but nothing enforced it here, unlikeatdr/contrail-gh#7, which added the same guard as a CI shell step. Prose survives only as long as everyone rereadsAGENTS.mdbefore touching a workflow file, which is the exact failure mode the contrail-gh guard exists to catch. This repo already runs pytest in CI, so wiring the check in as a test is cheap: no new CI step, no shell to maintain, just one more assertion in the suite that already runs.Checks
./venv/bin/ruff check .and./venv/bin/ruff format .pass./venv/bin/pytest -qpassesgh issue listfor open issues this change touches (none apply)Test plan
./venv/bin/pytest -q tests/test_workflow_naming.pypasses against the current three workflowsruff check,ruff format --check, andnpx prettier@3.9.6 --check AGENTS.mdall pass🤖 Generated with Claude Code
https://claude.ai/code/session_01PdrDTk2ipKDnwDGeSc6Xfq