fix: type-check jq_collector under mypy strict (#52) - #54
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.
Closes #52
Acceptance criterion (verbatim): "
uv run --frozen mypypasses withstrict = truein[tool.mypy], and CI's Types step enforces it."What changed
collector/pyproject.toml:strict = trueunder[tool.mypy], and the "not --strict yet" comment updated. CI's Types step runs bareuv run --frozen mypy, which reads this table, so the workflow needs no change.dict/list→dict[str, Any]/list[Any]ingithub.py,gitlab.pyandrepos.py. These hold forge JSON and raw YAML, whose shape the forge decides, soAnyis the honest element type.metrics.py:render,_healthandFleetCollector.collectnow returnIterator[Metric], andFleetCollector.__init__takes aStore.no-any-returnin the forge clients' JSON getters:response.json()is now bound to anobjectbefore being returned, which is what the signature already promised.Gates (from
collector/, asci.ymlruns them)uv run --frozen mypy: no issues in 11 files (strict)uv run --frozen ruff format/ruff check jq_collector tests: clean (the formatter rewrapped two long signatures)uv run --frozen python -m pytest --cov=jq_collector: 451 passed, 100%--python 3.11: 451 passed, 100%🤖 Generated with Claude Code