Repository navigation
feat: doctest the forge and origin helpers, and run doctests in CI (#40) - #45
Merged
Merged
Conversation
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.
Fixes #40
Acceptance criterion (verbatim):
What changed
Examples. They go where the docstrings already make claims, so each one checks something the prose asserts:
forge.normalise_gitlab_status:failed→failure, case and whitespace ignored,manual→cancelled, and an unknown status →stale(the "never a fleet-wide red" promise).origin.forge_for_host:gitlab.comandgitlab.*→ gitlab; anything else, including an empty host → github.origin.parse: the scp form; a nested GitLab namespace keeping every segment (the bug the module docstring describes); a path remote keeping only its tail; a one-segment path →None.Wiring.
collector/pyproject.tomladdsjq_collectortotestpathsand--doctest-modulestoaddopts.ci.ymlis unchanged: its existing test step incollector (lint + tests), and thecollector (tests, Python 3.11)job, now collect the doctests automatically. The same goes for a localuv run pytest.Checks (run locally from
collector/, as CI does)uv run --frozen ruff check …/ruff format --check …: passforge.py: 1,origin.py: 2), 100.00% coverage, floor met'failure'→'failed'), pytest exits 1 withFAILED jq_collector/forge.py::jq_collector.forge.normalise_gitlab_status.Not addressed
Doctests for the other nine modules. The issue scoped this to the two pure helper modules; the rest mostly need a network client or a git checkout to say anything.
Merge note
#44 (the mypy gate) also edits
collector/pyproject.toml, but in different hunks (thedevgroup line, and a new[tool.mypy]table). The two should merge in either order without conflict.Closes #40
🤖 Generated with Claude Code