style: suppress ty diagnostics that block CI
Metadata
Current evaluation
Merged PR #2957 to fix CI `lint-ty` failures by suppressing 22 diagnostics and fixing a redundant cast.
Resolution: closed resolved
Reason: The PR was merged to resolve CI `lint-ty` failures, as confirmed by passing CI checks and the description stating it fixes the failing job.
Evaluated by: mr-cal-bot
No scores available.
Issue body
The `lint / files` job has been failing on main (7 consecutive QA failures). #2952 fixed the `lint-ruff` half; this fixes the `lint-ty` half.
Suppresses 22 diagnostics with `ty: ignore` comments matching the intent already documented by the existing pyright and mypy ignores on the same lines:
| Count | Rule | Why |
|---|---|---|
| 17 | `invalid-mutable-override` | Deliberate pydantic field narrowing (`_BaseJujuOption.default` narrowed per subclass; `license`/`contact`/`issues`/`source_code` typed `None` to disable unused base properties) |
| 5 | `unresolved-attribute` | craft-parts types `properties_class` as the base `PluginProperties`, so `charm_entrypoint`/`charm_requirements` are invisible. That imprecision is upstream |
| 1 | `invalid-property-type-override` | A `reason` property on a test fake |
The 23rd diagnostic was a `redundant-cast` in `BasesConfiguration._expand_base`. `cast()` is a runtime no-op so removing it is behaviour-neutral, and `ty` exits non-zero on warnings so it needed fixing rather than suppressing.
**Verification:** `lint-ruff`, `lint-ty`, `lint-twine`, `lint-uv-lockfile`, `lint-actions` all pass. Tests: 2917 passed, 5 skipped, 3 xfailed.
**Note:** `lint-docs` fails locally with `lstat .venv/lib/python3.14: no such file or directory`. That reproduces on a clean `main` — it is a local environment issue (venv is python3.12, docs tooling wants 3.14) and CI's log shows only ruff and ty failing, so docs lint passes there.
## Follow-up
The 5 `unresolved-attribute` suppressions are papering over craft-parts typing that should be fixed upstream.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | closed resolved | Merged PR #2957 to fix CI `lint-ty` failures by suppressing 22 diagnostics and fixing a redundant cast. |
Update history
| Date | Change |
|---|---|
| closed | |
| updated | |
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2961 style: suppress ty diagnostics that block CI | charmcraft | merged | Merged PR #2961 adds ty-specific lint ignores to match existing pyright/mypy configurations and removes a redundant cast in _expand_base, resolving CI blocks. | |
| #335 fix(lint): suppress ty | imagecraft | merged | Merged in PR #335 as c270f0a, adding targeted ty suppressions in two files so lint passes; all CI checks passed. | |
| #910 style: fix ty error | craft-providers | merged | Merged in #910 via commit 30fc806, adding a targeted suppression for a ty false positive; all listed CI checks passed. | |
| #27 ci: type check with ty | craft-artifacts | merged | Merged PR #27 as commit 716f05a, adding ty type checking to CI and suppressing intentional type violations; related lint fixes landed in #20. | |
| #1698 style: ty | craft-parts | merged | Merged PR #1698 as commit 6b4db96f, enabling ty as a lint target and fixing its warnings across 37 files. | |
| #242 style: fix ty linting error | craft-platforms | merged | Merged PR #242 with a one-line fix for the ty linting error; the change landed as commit e8b89ce. | |
| #5970 Fix `ty` warnings | snapcraft | closed | Resolved all ty warnings via merged PRs #6015 (a36429c18) and #6027 (47bda5515); make lint-ty now runs cleanly. | |
| #434 style: silence ty warnings | craft-cli | merged | Merged PR #434 as commit ef91a65, adding targeted ty suppressions matching existing suppressions for other linters across two files. | |
| #160 style: silence the ty job | craft-platforms | merged | Merged PR #160 (commit 469db5d) by lengau silenced the experimental ty typecheck CI job and, as a drive-by, removed the leftover unused yamllint pre-commit hook; all CI checks passed. | |
| #938 style: ty | craft-providers | merged | Merged PR #938 as commit 44bcd1a, adding targeted ty suppressions across 8 files to ignore warnings introduced by the latest ty version. |