linting: address pyright issues
Metadata
Current evaluation
Merged following approval and passing CI. Updated type declarations to comply with Pyright 1.1.225 by adding Optional to None arguments and correcting callback type typos across 16 files.
Suggested action: —
No scores available.
Issue body
Pyright 1.1.225 correctly enforces use of `Optional` for arguments set to `None`,
so fix declarations to comply. Also fixed type declaration typos in callbacks.
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged following approval and passing CI. Updated type declarations to comply with Pyright 1.1.225 by adding Optional to None arguments and correcting callback type typos across 16 files. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Updated type declarations to comply with Pyright 1.1.225 by correctly applying Optional to None arguments and fixing callback type typos. Linting issues resolved and changes integrated. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #58 lint: fix typing issues with updated pyright | craft-archives | merged | Merged following reviewer approval and successful CI checks. Fixed typing errors introduced by an updated pyright version across seven files. Improved overall code coverage by 0.03%. | |
| #4205 lint: fix for pyright 1.1.312 | snapcraft | merged | Merged a fix for type errors in account.py triggered by Pyright 1.1.312's stricter kwargs validation. The change corrects type annotations, passes CI, and was approved by a reviewer. | |
| #4080 lint: initialize retcode to satisfy pyright | snapcraft | merged | Merged a minor lint fix initializing the retcode variable to 1 to satisfy pyright type checking. The harmless change was approved, passed CI with 100% diff coverage, and merged into main. | |
| #342 type: fix pyright possibly-unbound error | rockcraft | merged | Merged to resolve a pyright possibly-unbound type error. Approved by two reviewers, passed CI checks, and modified one file with three additions and two deletions. | |
| #84 packages: address issues raised by pyright 1.1.151 (CRAFT-303) | craft-parts | merged | Merged to address pyright 1.1.151 warnings for None indexing across four files. Approved by two reviewers and passing CI, the changes fix type checking issues previously ignored by older versions. | |
| #67 ci(linters): address warnings | craft-application | merged | Merged after addressing linter warnings by removing a pyright-incompatible type annotation on a classmethod parameter. Approved by two reviewers and passed CI checks before integration into main. | |
| #1706 style: drop mypy, pyright | craft-parts | merged | Merged after approval and passing CI. Replaced mypy and pyright with ty for type checking across 88 files. Redundant isinstance checks were deferred to a separate issue. | |
| #701 build(deps): update pyright to 1.1.358 | craft-parts | merged | Merged update to pyright version 1.1.358. Approved by two reviewers and passed CI. A lint issue was addressed separately in PR #702. The change modified three files with minimal adjustments. | |
| #4078 lint: fix multi-part imports | snapcraft | merged | Merged to main. Fixes linting errors from a pyright 1.1.299 regression that flagged multi-part imports. Updated imports across three files to comply with the new type checker. Approved and passed CI. |