linters: migrate to ruff
Metadata
Current evaluation
Migrated linters to Ruff with a legacy-specific ruff.toml. Approved by two reviewers, passed CI with 100% diff coverage, and merged into main with 167 additions and 35 deletions across 20 files.
Suggested action: —
No scores available.
Issue body
Most of the configuration in `pyproject.toml` comes from Alex's work in craft-parts. I had to add a separate `ruff.toml` in `snapcraft_legacy` to have legacy-specific configuration (basically just flake8). Output looks like this:

The PR is probably easier to review per-commit; the first commit has deps update from the #4011 PR because this branch started off that one.
(CRAFT-1505)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Migrated linters to Ruff with a legacy-specific ruff.toml. Approved by two reviewers, passed CI with 100% diff coverage, and merged into main with 167 additions and 35 deletions across 20 files. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main, migrating linters to ruff. A dedicated ruff.toml manages legacy configuration. The update maintains 100% diff coverage with no overall coverage change, building on PR #4011. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Migrated linters to ruff, adding a dedicated ruff.toml for legacy configuration. Maintains 100% diff coverage with no overall coverage change. Successfully merged into main. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #68 lint: update ruff and fix linting | craft-archives | merged | Merged into main following reviewer approval and passing CI. Updates ruff configuration and resolves linting issues across four files, maintaining 100% diff coverage with no overall coverage change. | |
| #33 lint: fix lint issues with newer ruff | craft-archives | merged | Merged to resolve linting failures introduced by a newer ruff version. Changes fix style checks across three files. Review approved, CI passed, and coverage remained unchanged. Additional unit tests were deferred to a separate tracking ticket. | |
| #337 Linters: migrate from flake8 to ruff | craft-parts | merged | Merged after approval, migrating linters from flake8 to ruff. Ruff is now the default, with flake8 retained as an optional make target. 4 files changed. | |
| #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. | |
| #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. | |
| #1825 style(lint): fix ruff 0.6.0 linting errors | charmcraft | merged | Merged following two reviewer approvals and passing CI. The change resolves ruff 0.6.0 linting errors across 31 files using ruff's autofix, resulting in 70 additions and 71 deletions. | |
| #55 lint: stricter ruff rules | starbase | merged | Merged stricter ruff linting rules. The change modifies one file with 23 additions and 9 deletions, enforces stricter configuration, and received reviewer approval before integration. | |
| #691 A couple of ruff-related updates | rockcraft | merged | Successfully merged pull request containing updates for the ruff linter. Changes affected three files, adding 16 and removing 35 lines. Approved by two reviewers and passed CI checks before integration. | |
| #803 style: fix linting issues with ruff 0.12 | craft-application | merged | Merged after approval by two reviewers. Resolves linting failures introduced by ruff 0.12 across 14 files. CI passed for fast tests, linting, and security scans, while slow test failures were tracked separately in #804. | |
| #815 fix linting issues for ruff 0.6 | craft-parts | merged | Merged following approval from two reviewers and passing CI checks. The pull request resolves linting compatibility issues for ruff 0.6 by applying manual and automated fixes across 44 files, modifying 98 lines of code. |