linters: add PLR2004 to ruff ignore
Metadata
Current evaluation
Merged PR #351 added PLR2004 to Ruff's test ignores, suppressing over 600 magic-value warnings. Landed as commit 517f95d8.
Resolution: closed resolved
Reason: Ruff's pyproject.toml now ignores PLR2004 for test files. Approved PR #351 was merged as commit 517f95d8.
Evaluated by: mr-cal-bot
No scores available.
Issue body
PLR2004 is "Magic value used in comparison, consider using a constant". This is triggering for things like expected messages in tests, so there were over 600 instances in craft-parts.
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #351 added PLR2004 to Ruff's test ignores, suppressing over 600 magic-value warnings. Landed as commit 517f95d8. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #351 added PLR2004 to Ruff's ignore list, suppressing magic-value lint warnings in tests (commit 517f95d8). | |
| qwen/qwen3.6-35b-a3b | — | — | Merged adding PLR2004 to the ruff ignore list to suppress false positives for magic value comparisons in tests. Approved, passed CI, and updated the configuration file with one line. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Added PLR2004 to the ruff ignore list to suppress over 600 false positive magic value comparison warnings in tests. The change was integrated without additional comments. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #151 style(lint): disable magic value check in tests | starbase | merged | Merged #151 as commit 073e450, adding a test-only Ruff ignore for PLR2004 so magic values are allowed in tests; fixes #148. | |
| #1154 fix(lint): ignore PLR0917 in tests alongside PLR0913 | craft-application | merged | Merged PR #1154 added Ruff PLR0917 to test per-file ignores alongside PLR0913, fixing nine fixture/parametrization lint failures; make lint-ruff passes. | |
| #907 style: adjust linting rules for ruff 0.12 | rockcraft | merged | Merged into main as 186cb0fb, updating Ruff 0.12 settings to ignore PLC0415 and avoid unnecessary noqa comments. | |
| #409 style(ruff): disable PLW1641 | starbase | merged | Merged PR #409 as commit 095cb0a, disabling Ruff rule PLW1641 (eq-without-hash); all CI checks passed. | |
| #301 lint: fix ruff warning PLC1901 | craft-providers | merged | Merged PR #301 (commit d547a8f) by maintainer mr-cal replaced `string == ""` checks with `not string` in 4 files (+4/-5), clearing ruff PLC1901 lint warnings. | |
| #68 lint: update ruff and fix linting | craft-archives | merged | Merged PR #68 as commit 8bb81ae, updating Ruff and fixing lint violations across four files after prerequisite #67. | |
| #33 lint: fix lint issues with newer ruff | craft-archives | merged | PR #33 merged as commit c2a6687, fixing new lint failures introduced by a newer Ruff release across3 files (+5/-3). Maintainer deferred extra unit tests to CRAFT-1641. | |
| #4012 linters: migrate to ruff | snapcraft | merged | Merged PR #4012 (commit a6e7d5f9d, CRAFT-1505): replaced the flake8/isort/black lint setup with Ruff, config ported from craft-parts#337, plus a legacy-specific ruff.toml; dependency updates from #4011 were included. | |
| #337 Linters: migrate from flake8 to ruff | craft-parts | merged | Merged PR #337 in commit 487e049f, making Ruff the default linter while retaining flake8 through the optional make test-flake8 target. | |
| #139 style: stricter ruff linters | starbase | merged | PR #139 was merged as commit a48d590, adding stricter Ruff lint rules across six files while retaining 100% test coverage. |