-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem Description
I'm opening this issue after PR #1018 to discuss how to implement the switch, in particular:
- which rules to enable (https://docs.astral.sh/ruff/rules/)
- which rules to disable
- python target version (https://docs.astral.sh/ruff/settings/#target-version)
- max line length (https://docs.astral.sh/ruff/settings/#line-length)
- CI integration (https://docs.astral.sh/ruff/integrations/#github-actions)
Proposed Solution
- Enabled rules:
The default enabled rules are:E4 E7 E9 F
I usually enable the following rules:E W I N D UP ASYNC S BLE B A COM C4 DTZ EM FA ISC ICN LOG G PIE PYI Q RSE RET SLF SIM TID TCH INT ARG TD FIX ERA PL TRY PERF FURB DOC RUF - Disabled rules:
I usually disable only specific rules when strictly necessary - Python target version: the oldest one you want to support (3.10?)
- max line length: 120?
- I usually don't touch other linter/formatter settings
- the above-linked documentation contains a good basic workflow, I suggest to enable it filtering when it runs, with something like
on:
push:
branches:
- 'main'
- 'develop'
paths:
- '**.py'
- 'pyproject.toml'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
workflow_dispatch:Alternatives Considered
There aren't many ruff alternatives, just stick with the old linters/formatter (maybe with better configurations), and run them one by one manually
Additional Information
ruff can be configured with its dedicated config file, or via pyproject.toml
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Projects
Status
In progress