| name | flake8-to-ruff |
| description | Migrate Python linting from flake8/isort to ruff. Use when pycqa/flake8 or PyCQA/isort is in .pre-commit-config.yaml or [tool.flake8]/[tool.isort] config exists. |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash(find *), Bash(test *), Bash(pre-commit *), Bash(uvx *), AskUserQuestion, TodoWrite |
| model | sonnet |
| args | [--check-only] [--fix] |
| argument-hint | [--check-only] [--fix] |
| created | "2026-04-14T00:00:00.000Z" |
| modified | "2026-05-09T00:00:00.000Z" |
| reviewed | "2026-04-14T00:00:00.000Z" |
/migration-patterns:flake8-to-ruff
Migrate from flake8 and/or isort to ruff — consolidating linting and import sorting into a single, fast Rust-based tool. Replaces pre-commit hooks, migrates rule configuration, and removes old dependencies.
When to Use This Skill
| Use this skill when... | Keep flake8/isort when... |
|---|
.pre-commit-config.yaml contains pycqa/flake8 or PyCQA/isort | You rely on a flake8 plugin with no ruff equivalent |
[tool.flake8] or [tool.isort] config exists | Team uses flake8 API in custom scripts |
| Looking to consolidate linting tooling | CI requires specific flake8 exit codes |
| Using ruff format and wanting a unified tool | |
Context
- Pre-commit config: !
find . -maxdepth 1 -name '.pre-commit-config.yaml'
- pyproject.toml: !
find . -maxdepth 1 -name 'pyproject.toml'
- setup.cfg: !
find . -maxdepth 1 -name 'setup.cfg'
- .flake8: !
find . -maxdepth 1 -name '.flake8'
- ruff already present: !
find . -maxdepth 1 -name 'ruff.toml'
Parameters
| Parameter | Description |
|---|
--check-only | Report what would change without modifying files |
--fix | Apply migration automatically |
Execution
Execute this flake8/isort-to-ruff migration:
Step 1: Audit current configuration
- Read
.pre-commit-config.yaml and locate pycqa/flake8, PyCQA/isort, and pycqa/pep8-naming entries.
- Read all config sources:
pyproject.toml ([tool.flake8], [tool.isort]), setup.cfg ([flake8], [isort]), .