← Back to issue list

feat: replace flake8 + plugins and isort with ruff

View original Github issue

Metadata

Project
charmcraft
Number
#932
Type
pull request
State
merged
Author
jnsgruk
Labels
Created
Updated
Closed

Current evaluation

Merged after approval and passing CI checks, replacing flake8, plugins, and isort with ruff to resolve CI instability from dependency conflicts. Updated six files to streamline Python linting.

Suggested action:

No scores available.

Issue body

We have previously standardised on using `flake8` with a number of plugins, and `pyproject-flake8` to enable us to configure all of our linting tools in one place (`pyproject.toml`) Over the past months, there have been two major releases of `flake8`, and both have caused various issues with the various plugins and their dependencies, leading to instability in CI pipelines. I've been following [ruff](https://github.com/charliermarsh/ruff) for a while. It's a Python linter, written in Rust, that combines a lot of the rules we were using from these other plugins. It's actively maintained, and all under one project, reducing the complexity of the dependency tree a little. It's got adoption from some pretty large projects like FastAPI and pydantic. Proposing here for discussion.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged after approval and passing CI checks, replacing flake8, plugins, and isort with ruff to resolve CI instability from dependency conflicts. Updated six files to streamline Python linting.
qwen3.6-35b-a3b-mtp-q6 Merged an external PR replacing flake8, plugins, and isort with ruff. This resolves CI instability from flake8 dependency conflicts, consolidating linting and formatting into a single, faster Rust-based tool.
qwen3.6-35b-a3b-mtp-q6 Merged an external PR replacing flake8, its plugins, and isort with ruff. This resolves CI instability from flake8 dependency conflicts, consolidating linting into a single, faster Rust-based tool.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1941 fix(templates): replace flake8 and pydocstyle with ruff charmcraft merged Merged changes replacing flake8 and pydocstyle with ruff in the templates directory. Approved by three reviewers, the update modifies 14 files and resolves issue #1461.
80%
#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.
78%
#2229 style: fix linting errors charmcraft merged Merged changes resolving linting errors from the latest ruff and pyright. Approved by two reviewers with zero unresolved comments. Updated 8 files, removing 22 lines overall.
75%
#1465 style: fix linting issues for newer ruff craft-parts merged Merged after two approvals and passing all CI checks. Resolves linting compatibility issues with newer ruff versions, updating five files.
75%
#4712 Move more linting to ruff snapcraft closed Completed. Linting configuration was updated to align with starbase, replacing isort with ruff and disabling redundant flake8 and pylint tests. Maintainer confirmed the changes and closed the issue.
74%
#580 style(ruff): fix linting issues from ruff update craft-application merged Merged after approval by three reviewers. Resolves linting errors from a ruff update, modifying three files with a +7/-7 line change. Successfully integrated into the codebase.
74%
#2902 static: fix some valid flake8 issues snapcraft merged Merged. Fixed unused typing imports flagged by flake8 across five Python files. Changes were approved, passed CI checks, and integrated into the codebase.
74%
#675 style(lint): replace pylint with ruff rockcraft merged Merged a pull request replacing pylint with ruff for linting. The author updated CI configuration and requirements files to include ruff and remove pylint, ensuring all linters were properly enabled. Approved by reviewers and passed CI checks.
74%
#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.
74%
#4817 style: remove pylint snapcraft merged Merged removal of pylint configuration, fully replaced by ruff. Approved by three reviewers, passed CI checks, and modified 46 files across the codebase.
73%