← Back to issue list

style: enforce strict checking for shadowing

View original Github issue

Metadata

Project
craft-parts
Number
#1045
Type
pull request
State
merged
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

Merged after approval. Updates Ruff configuration to enforce strict module shadowing checks, maintaining previous strictness after Ruff 0.10 relaxed the default rule. Approved by two reviewers and passed CI.

Suggested action:

No scores available.

Issue body

- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you added an entry to the changelog (`docs/reference/changelog.rst`)? ----- Ruff 0.10 made the [rule for module shadowing](https://docs.astral.sh/ruff/settings/#lint_flake8-builtins_strict-checking) less strict by default. My preference is to keep the same level of strictness. See the "failure" [here](https://github.com/canonical/craft-parts/actions/runs/13917827360/job/38944036599?pr=1044), where a `noqa` becomes superfluous.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged after approval. Updates Ruff configuration to enforce strict module shadowing checks, maintaining previous strictness after Ruff 0.10 relaxed the default rule. Approved by two reviewers and passed CI.
qwen3.6-35b-a3b-mtp-q6 Merged to enforce strict module shadowing checks in Ruff, overriding the relaxed default in v0.10. The configuration change was approved and slated for upstreaming to the starbase project.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#582 style: ruff 0.16 starbase merged Merged following two approvals and successful CI checks. Updates ruff to 0.16 and adds a configuration to ignore the PLR0917 rule for tests.
76%
#368 style: enforce strict checking for shadowing starbase merged Merged upstream changes enforcing strict variable shadowing checks. Approved by two reviewers, passed CI, and added three lines to one file. Implements style enforcement for the repository.
76%
#5343 style: ruff 0.11 fixes snapcraft merged Merged minor style updates to align with ruff 0.10 and 0.11. Approved by two reviewers, passed CI checks, and merged with minimal changes across one file.
73%
#6378 style: ruff 0.16 snapcraft merged Merged housekeeping updates: ruff 0.16 configuration, cryptography CVE fix, and removal of an outdated maturin constraint. Approved by two reviewers and passed CI checks prior to merge.
72%
#139 style: stricter ruff linters starbase merged Merged stricter ruff linter rules across six files (+50/-33 lines). Approved by four reviewers, passed CI checks, and maintained 100% test coverage.
72%
#236 build: update ruff settings craft-cli merged Merged following approval from two reviewers and passing CI checks. The change updates ruff configuration settings with a five-line modification to align linting rules.
72%
#408 style: fix linting for ruff 0.12 starbase merged Merged a one-line update to resolve linting errors for ruff 0.12. Approved by two reviewers and passed all CI checks before integration.
72%
#101 ruff: remove type-checking guard blocks starbase merged Merged removal of type-checking guard blocks from ruff configuration per internal decision. Approved by reviewer, passed CI, and maintained 100% coverage with a minimal two-line diff.
71%
#173 style: fix lint for ruff 0.12 craft-archives merged Merged following two approvals and passing CI checks. Resolves lint compatibility for ruff 0.12 while preserving backwards compatibility with ruff 0.11. Applied via a minimal two-line adjustment.
71%
#415 style: fix ruff 0.16 warning craft-store merged Merged after two approvals and passing CI. Resolved a ruff 0.16 warning by adding an ignore directive copied from Starbase. The change added a single line to one file.
70%