← Back to issue list

lint: fix for pyright 1.1.312

View original Github issue

Metadata

Project
snapcraft
Number
#4205
Type
pull request
State
merged
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

No scores available.

Issue body

- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [X] Have you successfully run `make lint`? - [ ] Have you successfully run `pytest tests/unit`? ----- [Pyright 1.1.312](https://github.com/microsoft/pyright/releases/tag/1.1.312) now type-checks `kwargs`. This started causing the following error: ```shell lint-pyright: commands[0]> pyright added 1 package, and audited 2 packages in 2s found 0 vulnerabilities /home/developer/dev/snapcraft/snapcraft/commands/account.py /home/developer/dev/snapcraft/snapcraft/commands/account.py:215:68 - error: Argument of type "str | int" cannot be assigned to parameter "ttl" of type "int" in function "login"   Type "str | int" cannot be assigned to type "int"     "str" is incompatible with "int" (reportGeneralTypeIssues) /home/developer/dev/snapcraft/snapcraft/commands/account.py:215:68 - error: Argument of type "str | int" cannot be assigned to parameter "acls" of type "Sequence[str] | None" in function "login"   Type "str | int" cannot be assigned to type "Sequence[str] | None"     Type "int" cannot be assigned to type "Sequence[str] | None"       "int" is incompatible with "Sequence[str]"       Type cannot be assigned to type "None" (reportGeneralTypeIssues) /home/developer/dev/snapcraft/snapcraft/commands/account.py:215:68 - error: Argument of type "str | int" cannot be assigned to parameter "packages" of type "Sequence[str] | None" in function "login"   Type "str | int" cannot be assigned to type "Sequence[str] | None"     Type "int" cannot be assigned to type "Sequence[str] | None"       "int" is incompatible with "Sequence[str]"       Type cannot be assigned to type "None" (reportGeneralTypeIssues) /home/developer/dev/snapcraft/snapcraft/commands/account.py:215:68 - error: Argument of type "str | int" cannot be assigned to parameter "channels" of type "Sequence[str] | None" in function "login"   Type "str | int" cannot be assigned to type "Sequence[str] | None"     Type "int" cannot be assigned to type "Sequence[str] | None"       "int" is incompatible with "Sequence[str]"       Type cannot be assigned to type "None" (reportGeneralTypeIssues) 4 errors, 0 warnings, 0 informations ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b 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.
qwen3.6-35b-a3b-mtp-q6 Merged a fix for pyright 1.1.312 type errors in account.py. Resolved kwargs type mismatches for ttl, acls, packages, and channels. Maintainer mr-cal merged the change, achieving 100% diff coverage with no overall coverage impact.
qwen3.6-35b-a3b-mtp-q6 Merged into main. Resolves pyright 1.1.312 type-checking errors in account.py caused by stricter kwargs validation. Fixes type mismatches for ttl, acls, packages, and channels parameters. Codecov confirms 100% diff coverage.

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%.
79%
#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.
77%
#177 linting: address pyright issues craft-parts merged 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.
76%
#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.
76%
#1703 build: update pyright to 1.1.366 charmcraft merged Merged update to pyright version 1.1.366. The change modified two files with a net reduction of five lines. Approved by one reviewer with no unresolved comments before integration.
76%
#1294 style: enable strict type checking with pyright craft-parts merged Merged PR enabling strict type checking with pyright. All resulting type errors were resolved, improving the project's typing and linting status. The change passed CI checks and was approved, successfully integrating stricter type safety.
75%
#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.
75%
#237 style: fix pyright config craft-cli merged Merged a two-line fix to the pyright configuration, correcting ignores to apply recursively. Approved by two reviewers, passed CI, and integrated.
74%
#254 build(deps): update dependency pyright to v1.1.381 starbase merged Merged automated dependency update upgrading pyright to v1.1.381. Approved by one reviewer, passed CI checks, and modified one file with two additions and two deletions.
73%
#249 build(deps): update dependency pyright to v1.1.380 starbase merged Merged automated dependency update upgrading pyright from v1.1.379 to v1.1.380. Approved by one reviewer, passed CI checks, and modified a single file.
73%