← Back to issue list

fix: clear ty diagnostics for partition-number helpers

View original Github issue

Metadata

Project
imagecraft
Number
#341
Type
pull request
State
merged
Author
mwhudson
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #341 as commit 96c4d21, fixing ty diagnostics in partition-number helpers by removing a mypy-only ignore, widening the volume type, and typing test structures.

Resolution: closed resolved

Reason: PR #341 was approved and merged as commit 96c4d21. It resolves the reported ty diagnostics, with lint and all reported CI checks passing.

Evaluated by: mr-cal-bot

No scores available.

Issue body

ty (the static type checker run by `make lint-ty`) flagged three genuine issues in code introduced by the MBR support PR: - grubutil._part_num used `# type: ignore[union-attr]` (mypy syntax) to reach `partition_number` on a union containing variants that don't define it. Capture the result of getattr() in a local instead, removing the need for any ignore. - ImageService._get_partition_numbers was annotated with `GPTVolume | MBRVolume`, but its only caller passes `GPTVolume | MBRVolume | HybridVolume`. The implementation already handles HybridVolume correctly (volume_schema is HYBRID, so the MBR-extended path is skipped); widen the parameter type to match. - test_part_num_{mbr_plain,mbr_extended,gpt} build their structure list from MagicMock instances. ty doesn't see through `spec=MBRStructureItem`, so the call to _part_num looked ill-typed. Cast to MBRStructureList / GPTStructureList at construction so the rest of the test reads naturally. `make lint-ty` and `make lint-ruff` both pass clean afterwards.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #341 as commit 96c4d21, fixing ty diagnostics in partition-number helpers by removing a mypy-only ignore, widening the volume type, and typing test structures.
stealth/space-bunny-alpha — closed resolved Merged a 3-file fix to clear ty errors in partition-number helpers: removed a mypy ignore, widened a volume type to include HybridVolume, and typed test mocks.
qwen/qwen3.6-35b-a3b — — Merged after fixing three static type-checking diagnostics for partition-number helpers. Changes remove type ignores, widen parameter annotations, and fix test mock types. All linting and CI checks pass after two reviewer approvals.
qwen3.6-35b-a3b-mtp-q6 — — Merged a fix for three static type-checking issues in partition-number helpers. The update removes type ignore directives, widens parameter annotations to match actual usage, and corrects test type casting. Linting now passes clean.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.