mirror of https://github.com/astral-sh/ruff
Update default configuration.md to mention C901 rule (#5397)
This commit is contained in:
parent
c5e20505f8
commit
139a9f757b
|
|
@ -11,12 +11,14 @@ If left unspecified, Ruff's default configuration is equivalent to:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
|
# Enable the pycodestyle (`E`) and Pyflakes (`F`) rules by default.
|
||||||
|
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
|
||||||
|
# McCabe complexity (`C901`) by default.
|
||||||
select = ["E", "F"]
|
select = ["E", "F"]
|
||||||
ignore = []
|
ignore = []
|
||||||
|
|
||||||
# Allow autofix for all enabled rules (when `--fix`) is provided.
|
# Allow autofix for all enabled rules (when `--fix`) is provided.
|
||||||
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
|
fixable = ["ALL"]
|
||||||
unfixable = []
|
unfixable = []
|
||||||
|
|
||||||
# Exclude a variety of commonly ignored directories.
|
# Exclude a variety of commonly ignored directories.
|
||||||
|
|
@ -53,10 +55,6 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
||||||
|
|
||||||
# Assume Python 3.10.
|
# Assume Python 3.10.
|
||||||
target-version = "py310"
|
target-version = "py310"
|
||||||
|
|
||||||
[tool.ruff.mccabe]
|
|
||||||
# Unlike Flake8, default to a complexity level of 10.
|
|
||||||
max-complexity = 10
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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: (1) enforce flake8-bugbear rules, in addition
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue