← Back to issue list

lint: initialize retcode to satisfy pyright

View original Github issue

Metadata

Project
snapcraft
Number
#4080
Type
pull request
State
merged
Author
tigarmo
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

No scores available.

Issue body

Latest version of pyright complains that `retcode` might not be initialized. As far as I can tell, every code path sets a value (except for `run_legacy()` which does its own exit handling), so this initial setting to 1 is spurious but should be harmless. - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `make lint`? - [ ] Have you successfully run `pytest tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b 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.
qwen3.6-35b-a3b-mtp-q6 Merged a fix to initialize the retcode variable, resolving a pyright static analysis warning. The change satisfies the linter without altering runtime behavior and was accepted with full diff coverage.
qwen3.6-35b-a3b-mtp-q6 Merged into main. Initialized the retcode variable to 1 to resolve a pyright linting warning about potential uninitialized variables. The harmless change maintains full test 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%.
78%
#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.
76%
#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.
75%
#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.
73%
#4485 style(lint): fix pyright errors snapcraft merged Merged after approval by three reviewers. Resolved pyright linting errors across nine files (+59/-38 lines). Codecov confirmed test coverage remained stable at 89.2%.
73%
#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.
71%
#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.
71%
#4233 type: workaround for pyright bug snapcraft merged Merged a two-file change (+4/-3 lines) implementing a workaround for pyright bug #5394. Approved by one reviewer, passed CI checks, and successfully integrated into the codebase.
70%
#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.
70%