[AAASM-4942] 🐛 (scripts): Make check_readme_version --check flag meaningful#292
Conversation
The parsed args were discarded, so --check was a no-op: audit() ran unconditionally and drift always forced exit 1 regardless of the flag. Read args.check so --check gates (exit 1 on drift, the CI mode) while a bare invocation reports drift but exits 0 for informational runs. Refs AAASM-4942
…ting Pin the two distinct modes so --check can't regress to a no-op: --check exits 1 on drift while a bare run reports drift but exits 0. Refs AAASM-4942
🤖 Claude Code reviewScope — Two commits: the one-word-of-logic fix ( Root cause — Fix — Capture Risk — Low. The CI gate keeps failing on drift exactly as before (it passes Validation — |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|



Description
scripts/check_readme_version.pyaccepted a--checkflag but never read itsparsed value:
parser.parse_args(argv)was discarded andaudit()ranunconditionally, so drift always returned exit 1 regardless of the flag. The flag
implied a mode that didn't exist. This makes it meaningful:
--check(the CI-gate mode, unchanged for callers): exit 1 on drift.The on-sync path is identical in both modes (prints the in-sync message, exits 0),
so the existing CI invocation (
python scripts/check_readme_version.py --checkinreadme-version-check.yml) and theCONTRIBUTING.mdguidance keep working with nocaller changes.
Type of Change
Breaking Changes
Related Issues
Testing
New
test/unit/test_check_readme_version.pypins the two modes (loads the scriptvia
importlib, monkeypatches_repo_rootonto a temp tree):--checkexits 1 ondrift, bare run exits 0 on drift, both exit 0 when in sync.
Manual validation:
.venv/bin/python scripts/check_readme_version.py --checkon the current tree → exit 0.--check→ exit 1, bare → exit 0.ruff check+ruff format --check+mypyclean; new tests pass.Checklist