mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 12:29:48 +00:00
Deduplicate information in configuration documentation (#7108)
This commit is contained in:
parent
c7217e34d7
commit
af189db5eb
1 changed files with 5 additions and 8 deletions
|
@ -57,23 +57,20 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
||||||
target-version = "py38"
|
target-version = "py38"
|
||||||
```
|
```
|
||||||
|
|
||||||
As an example, the following would configure Ruff to: (1) enforce flake8-bugbear rules, in addition
|
As an example, the following would configure Ruff to:
|
||||||
to the defaults; (2) avoid enforcing line-length violations (`E501`); (3) avoid attempting to fix
|
|
||||||
flake8-bugbear (`B`) violations; and (3) ignore import-at-top-of-file violations (`E402`) in
|
|
||||||
`__init__.py` files:
|
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
# Enable flake8-bugbear (`B`) rules.
|
# 1. Enable flake8-bugbear (`B`) rules, in addition to the defaults.
|
||||||
select = ["E", "F", "B"]
|
select = ["E", "F", "B"]
|
||||||
|
|
||||||
# Never enforce `E501` (line length violations).
|
# 2. Avoid enforcing line-length violations (`E501`)
|
||||||
ignore = ["E501"]
|
ignore = ["E501"]
|
||||||
|
|
||||||
# Avoid trying to fix flake8-bugbear (`B`) violations.
|
# 3. Avoid trying to fix flake8-bugbear (`B`) violations.
|
||||||
unfixable = ["B"]
|
unfixable = ["B"]
|
||||||
|
|
||||||
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
|
# 4. Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
|
||||||
[tool.ruff.per-file-ignores]
|
[tool.ruff.per-file-ignores]
|
||||||
"__init__.py" = ["E402"]
|
"__init__.py" = ["E402"]
|
||||||
"path/to/file.py" = ["E402"]
|
"path/to/file.py" = ["E402"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue