linters: add PLR2004 to ruff ignore
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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 |
|---|---|---|---|---|
| #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. | |
| #409 style(ruff): disable PLW1641 | starbase | merged | Merged after two approvals and passing CI checks. Disables the Ruff PLW1641 (eq-without-hash) lint rule via a single configuration change. Related lint fixes were handled in PRs #410 and #411. | |
| #1154 fix(lint): ignore PLR0917 in tests alongside PLR0913 | craft-application | merged | Merged a lint fix extending the PLR0913 test ignore to also suppress PLR0917. This resolves nine lint errors in test files caused by pytest fixtures and parametrization, allowing make lint-ruff to pass. Approved by two reviewers with all CI checks passing. | |
| #349 linters: fix new ruff issues | craft-parts | merged | Merged after approval and passing CI. Adjusted ruff configuration to permit temporary directories in tests and marked hashlib.sha1() as non-security usage, resolving new linter warnings. | |
| #148 [DISCUSS] Disable magic value linter for tests? | starbase | closed | Resolved. The PLR2004 magic value comparison rule will be disabled for test files. The private/protected method usage rule was also disabled for tests. |