Skip to content

fix: type-check jq_collector under mypy strict (#52) - #54

Merged
tschm merged 1 commit into
mainfrom
rhiza_fix_52_20260925
Sep 25, 2026
Merged

tschm merged 1 commit into
mainfrom
rhiza_fix_52_20260925

Conversation

@tschm

@tschm tschm commented Sep 25, 2026

Copy link
Copy Markdown
Member

Closes #52

Acceptance criterion (verbatim): "uv run --frozen mypy passes with strict = true in [tool.mypy], and CI's Types step enforces it."

What changed

  • collector/pyproject.toml: strict = true under [tool.mypy], and the "not --strict yet" comment updated. CI's Types step runs bare uv run --frozen mypy, which reads this table, so the workflow needs no change.
  • The 32 errors strict mode surfaced, all annotation-only:
    • 26 × bare dict / list → dict[str, Any] / list[Any] in github.py, gitlab.py and repos.py. These hold forge JSON and raw YAML, whose shape the forge decides, so Any is the honest element type.
    • 4 × untyped defs in metrics.py: render, _health and FleetCollector.collect now return Iterator[Metric], and FleetCollector.__init__ takes a Store.
    • 2 × no-any-return in the forge clients' JSON getters: response.json() is now bound to an object before being returned, which is what the signature already promised.
  • No behaviour change.

Gates (from collector/, as ci.yml runs 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%
  • The same suite on --python 3.11: 451 passed, 100%

🤖 Generated with Claude Code

@tschm
tschm merged commit 03e9b05 into main Sep 25, 2026
5 checks passed
@tschm
tschm deleted the rhiza_fix_52_20260925 branch September 25, 2026 13:04
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.

Tighten mypy on jq_collector to strict

1 participant