mirror of https://github.com/astral-sh/ruff
Use human-readable types for documentation values (#2375)
This commit is contained in:
parent
ad8693e3de
commit
00495e8620
129
README.md
129
README.md
|
|
@ -2077,7 +2077,7 @@ enforcing `RUF001`, `RUF002`, and `RUF003`.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<char>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2097,7 +2097,7 @@ system builtins.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2123,7 +2123,7 @@ variable, if set.
|
||||||
|
|
||||||
**Default value**: `.ruff_cache`
|
**Default value**: `.ruff_cache`
|
||||||
|
|
||||||
**Type**: `PathBuf`
|
**Type**: `str`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2142,7 +2142,7 @@ default expression matches `_`, `__`, and `_var`, but not `_var_`.
|
||||||
|
|
||||||
**Default value**: `"^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"`
|
**Default value**: `"^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"`
|
||||||
|
|
||||||
**Type**: `Regex`
|
**Type**: `re.Pattern`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2175,7 +2175,7 @@ Note that you'll typically want to use
|
||||||
|
|
||||||
**Default value**: `[".bzr", ".direnv", ".eggs", ".git", ".hg", ".mypy_cache", ".nox", ".pants.d", ".ruff_cache", ".svn", ".tox", ".venv", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", "venv"]`
|
**Default value**: `[".bzr", ".direnv", ".eggs", ".git", ".hg", ".mypy_cache", ".nox", ".pants.d", ".ruff_cache", ".svn", ".tox", ".venv", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", "venv"]`
|
||||||
|
|
||||||
**Type**: `Vec<FilePattern>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2198,7 +2198,7 @@ in the current configuration file.
|
||||||
|
|
||||||
**Default value**: `None`
|
**Default value**: `None`
|
||||||
|
|
||||||
**Type**: `Path`
|
**Type**: `str`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2231,7 +2231,7 @@ For more information on the glob syntax, refer to the [`globset` documentation](
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<FilePattern>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2253,7 +2253,7 @@ since its usage is now interchangeable with `ignore`.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<RuleSelector>`
|
**Type**: `list[RuleSelector]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2272,7 +2272,7 @@ specified by `select`.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<RuleSelector>`
|
**Type**: `list[RuleSelector]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2293,7 +2293,7 @@ by Ruff.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2348,7 +2348,7 @@ considered autofixable.
|
||||||
|
|
||||||
**Default value**: `["A", "ANN", "ARG", "B", "BLE", "C", "COM", "D", "DTZ", "E", "EM", "ERA", "EXE", "F", "FBT", "G", "I", "ICN", "INP", "ISC", "N", "PD", "PGH", "PIE", "PL", "PT", "PTH", "Q", "RET", "RUF", "S", "SIM", "T", "TCH", "TID", "TRY", "UP", "W", "YTT"]`
|
**Default value**: `["A", "ANN", "ARG", "B", "BLE", "C", "COM", "D", "DTZ", "E", "EM", "ERA", "EXE", "F", "FBT", "G", "I", "ICN", "INP", "ISC", "N", "PD", "PGH", "PIE", "PL", "PT", "PTH", "Q", "RET", "RUF", "S", "SIM", "T", "TCH", "TID", "TRY", "UP", "W", "YTT"]`
|
||||||
|
|
||||||
**Type**: `Vec<RuleSelector>`
|
**Type**: `list[RuleSelector]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2396,7 +2396,7 @@ Actions annotations), `"gitlab"` (GitLab CI code quality report), or
|
||||||
|
|
||||||
**Default value**: `"text"`
|
**Default value**: `"text"`
|
||||||
|
|
||||||
**Type**: `SerializationType`
|
**Type**: `"text" | "json" | "junit" | "github" | "gitlab" | "pylint"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2420,7 +2420,7 @@ specific prefixes.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<RuleSelector>`
|
**Type**: `list[RuleSelector]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2459,7 +2459,7 @@ The line length to use when enforcing long-lines violations (like
|
||||||
|
|
||||||
**Default value**: `88`
|
**Default value**: `88`
|
||||||
|
|
||||||
**Type**: `usize`
|
**Type**: `int`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2479,7 +2479,7 @@ contained an `__init__.py` file.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<PathBuf>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2497,7 +2497,7 @@ exclude, when considering any matching files.
|
||||||
|
|
||||||
**Default value**: `{}`
|
**Default value**: `{}`
|
||||||
|
|
||||||
**Type**: `HashMap<String, Vec<RuleSelector>>`
|
**Type**: `dict[str, list[RuleSelector]]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2519,7 +2519,7 @@ file).
|
||||||
|
|
||||||
**Default value**: `None`
|
**Default value**: `None`
|
||||||
|
|
||||||
**Type**: `String`
|
**Type**: `str`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2561,7 +2561,7 @@ specific prefixes.
|
||||||
|
|
||||||
**Default value**: `["E", "F"]`
|
**Default value**: `["E", "F"]`
|
||||||
|
|
||||||
**Type**: `Vec<RuleSelector>`
|
**Type**: `list[RuleSelector]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2621,7 +2621,7 @@ variables will also be expanded.
|
||||||
|
|
||||||
**Default value**: `["."]`
|
**Default value**: `["."]`
|
||||||
|
|
||||||
**Type**: `Vec<PathBuf>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2642,7 +2642,7 @@ and instead must be specified explicitly (as seen below).
|
||||||
|
|
||||||
**Default value**: `"py310"`
|
**Default value**: `"py310"`
|
||||||
|
|
||||||
**Type**: `PythonVersion`
|
**Type**: `"py37" | "py38" | "py39" | "py310" | "py311"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2664,7 +2664,7 @@ detection (`ERA`), and skipped by line-length rules (`E501`) if
|
||||||
|
|
||||||
**Default value**: `["TODO", "FIXME", "XXX"]`
|
**Default value**: `["TODO", "FIXME", "XXX"]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2688,7 +2688,7 @@ as ordinary Python objects.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2705,7 +2705,7 @@ A list of rule codes or prefixes to consider non-autofix-able.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<RuleSelector>`
|
**Type**: `list[RuleSelector]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2839,7 +2839,7 @@ A list of directories to consider temporary.
|
||||||
|
|
||||||
**Default value**: `["/tmp", "/var/tmp", "/dev/shm"]`
|
**Default value**: `["/tmp", "/var/tmp", "/dev/shm"]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2857,7 +2857,7 @@ specified by `hardcoded-tmp-directory`.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2877,7 +2877,7 @@ e.g., the `no-mutable-default-argument` rule (`B006`).
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2897,7 +2897,7 @@ Ignore list of builtins.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2916,7 +2916,7 @@ Maximum string length for string literals in exception messages.
|
||||||
|
|
||||||
**Default value**: `0`
|
**Default value**: `0`
|
||||||
|
|
||||||
**Type**: `usize`
|
**Type**: `int`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2963,7 +2963,7 @@ the `extend_aliases` option.
|
||||||
|
|
||||||
**Default value**: `{"altair": "alt", "matplotlib": "mpl", "matplotlib.pyplot": "plt", "numpy": "np", "pandas": "pd", "seaborn": "sns", "tensorflow": "tf", "holoviews": "hv", "panel": "pn", "plotly.express": "px", "polars": "pl", "pyarrow": "pa"}`
|
**Default value**: `{"altair": "alt", "matplotlib": "mpl", "matplotlib.pyplot": "plt", "numpy": "np", "pandas": "pd", "seaborn": "sns", "tensorflow": "tf", "holoviews": "hv", "panel": "pn", "plotly.express": "px", "polars": "pl", "pyarrow": "pa"}`
|
||||||
|
|
||||||
**Type**: `FxHashMap<String, String>`
|
**Type**: `dict[str, str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -2988,7 +2988,7 @@ will be added to the `aliases` mapping.
|
||||||
|
|
||||||
**Default value**: `{}`
|
**Default value**: `{}`
|
||||||
|
|
||||||
**Type**: `FxHashMap<String, String>`
|
**Type**: `dict[str, str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3057,7 +3057,7 @@ The following values are supported:
|
||||||
|
|
||||||
**Default value**: `tuple`
|
**Default value**: `tuple`
|
||||||
|
|
||||||
**Type**: `ParametrizeNameType`
|
**Type**: `"csv" | "tuple" | "list"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3079,7 +3079,7 @@ case of multiple parameters. The following values are supported:
|
||||||
|
|
||||||
**Default value**: `tuple`
|
**Default value**: `tuple`
|
||||||
|
|
||||||
**Type**: `ParametrizeValuesRowType`
|
**Type**: `"tuple" | "list"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3099,7 +3099,7 @@ The following values are supported:
|
||||||
|
|
||||||
**Default value**: `list`
|
**Default value**: `list`
|
||||||
|
|
||||||
**Type**: `ParametrizeValuesType`
|
**Type**: `"tuple" | "list"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3123,7 +3123,7 @@ list.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3141,7 +3141,7 @@ List of exception names that require a match= parameter in a
|
||||||
|
|
||||||
**Default value**: `["BaseException", "Exception", "ValueError", "OSError", "IOError", "EnvironmentError", "socket.error"]`
|
**Default value**: `["BaseException", "Exception", "ValueError", "OSError", "IOError", "EnvironmentError", "socket.error"]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3176,12 +3176,11 @@ avoid-escape = false
|
||||||
|
|
||||||
#### [`docstring-quotes`](#docstring-quotes)
|
#### [`docstring-quotes`](#docstring-quotes)
|
||||||
|
|
||||||
Quote style to prefer for docstrings (either "single" (`'`) or "double"
|
Quote style to prefer for docstrings (either "single" or "double").
|
||||||
(`"`)).
|
|
||||||
|
|
||||||
**Default value**: `"double"`
|
**Default value**: `"double"`
|
||||||
|
|
||||||
**Type**: `Quote`
|
**Type**: `"single" | "double"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3194,12 +3193,12 @@ docstring-quotes = "single"
|
||||||
|
|
||||||
#### [`inline-quotes`](#inline-quotes)
|
#### [`inline-quotes`](#inline-quotes)
|
||||||
|
|
||||||
Quote style to prefer for inline strings (either "single" (`'`) or
|
Quote style to prefer for inline strings (either "single" or
|
||||||
"double" (`"`)).
|
"double").
|
||||||
|
|
||||||
**Default value**: `"double"`
|
**Default value**: `"double"`
|
||||||
|
|
||||||
**Type**: `Quote`
|
**Type**: `"single" | "double"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3212,12 +3211,12 @@ inline-quotes = "single"
|
||||||
|
|
||||||
#### [`multiline-quotes`](#multiline-quotes)
|
#### [`multiline-quotes`](#multiline-quotes)
|
||||||
|
|
||||||
Quote style to prefer for multiline strings (either "single" (`'`) or
|
Quote style to prefer for multiline strings (either "single" or
|
||||||
"double" (`"`)).
|
"double").
|
||||||
|
|
||||||
**Default value**: `"double"`
|
**Default value**: `"double"`
|
||||||
|
|
||||||
**Type**: `Quote`
|
**Type**: `"single" | "double"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3237,7 +3236,7 @@ that extend into the parent module or beyond (`"parents"`).
|
||||||
|
|
||||||
**Default value**: `"parents"`
|
**Default value**: `"parents"`
|
||||||
|
|
||||||
**Type**: `Strictness`
|
**Type**: `"parents" | "all"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3257,7 +3256,7 @@ and can be circumvented via `eval` or `importlib`.
|
||||||
|
|
||||||
**Default value**: `{}`
|
**Default value**: `{}`
|
||||||
|
|
||||||
**Type**: `HashMap<String, BannedApi>`
|
**Type**: `dict[str, { "msg": str }]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3279,7 +3278,7 @@ blocks.
|
||||||
|
|
||||||
**Default value**: `["typing"]`
|
**Default value**: `["typing"]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3337,7 +3336,7 @@ An override list of tokens to always recognize as a Class for
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3373,7 +3372,7 @@ for `order-by-type` regardless of casing.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3391,7 +3390,7 @@ known to Ruff in advance.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3478,7 +3477,7 @@ can be identified as such via introspection of the local filesystem.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3496,7 +3495,7 @@ can be identified as such via introspection of the local filesystem.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3514,7 +3513,7 @@ section via empty lines.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Option<Vec<ImportType>>`
|
**Type**: `list["future" | "standard-library" | "third-party" | "first-party" | "local-folder"]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3556,7 +3555,7 @@ this to "closest-to-furthest" is equivalent to isort's `reverse-relative
|
||||||
|
|
||||||
**Default value**: `furthest-to-closest`
|
**Default value**: `furthest-to-closest`
|
||||||
|
|
||||||
**Type**: `RelativeImportsOrder`
|
**Type**: `"furthest-to-closest" | "closest-to-furthest"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3573,7 +3572,7 @@ Add the specified import line to all files.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3590,7 +3589,7 @@ One or more modules to exclude from the single line rule.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3628,7 +3627,7 @@ for `order-by-type` regardless of casing.
|
||||||
|
|
||||||
**Default value**: `[]`
|
**Default value**: `[]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3647,7 +3646,7 @@ The maximum McCabe complexity to allow before triggering `C901` errors.
|
||||||
|
|
||||||
**Default value**: `10`
|
**Default value**: `10`
|
||||||
|
|
||||||
**Type**: `usize`
|
**Type**: `int`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3670,7 +3669,7 @@ expect that any method decorated by a decorator in this list takes a
|
||||||
|
|
||||||
**Default value**: `["classmethod"]`
|
**Default value**: `["classmethod"]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3688,7 +3687,7 @@ A list of names to ignore when considering `pep8-naming` violations.
|
||||||
|
|
||||||
**Default value**: `["setUp", "tearDown", "setUpClass", "tearDownClass", "setUpModule", "tearDownModule", "asyncSetUp", "asyncTearDown", "setUpTestData", "failureException", "longMessage", "maxDiff"]`
|
**Default value**: `["setUp", "tearDown", "setUpClass", "tearDownClass", "setUpModule", "tearDownModule", "asyncSetUp", "asyncTearDown", "setUpTestData", "failureException", "longMessage", "maxDiff"]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3708,7 +3707,7 @@ expect that any method decorated by a decorator in this list has no
|
||||||
|
|
||||||
**Default value**: `["staticmethod"]`
|
**Default value**: `["staticmethod"]`
|
||||||
|
|
||||||
**Type**: `Vec<String>`
|
**Type**: `list[str]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3748,7 +3747,7 @@ documentation (`W505`), including standalone comments.
|
||||||
|
|
||||||
**Default value**: `None`
|
**Default value**: `None`
|
||||||
|
|
||||||
**Type**: `usize`
|
**Type**: `int`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3768,7 +3767,7 @@ defaults when analyzing docstring sections.
|
||||||
|
|
||||||
**Default value**: `None`
|
**Default value**: `None`
|
||||||
|
|
||||||
**Type**: `Convention`
|
**Type**: `"google" | "numpy" | "pep257"`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3788,7 +3787,7 @@ Constant types to ignore when used as "magic values" (see: `PLR2004`).
|
||||||
|
|
||||||
**Default value**: `["str", "bytes"]`
|
**Default value**: `["str", "bytes"]`
|
||||||
|
|
||||||
**Type**: `Vec<ConstantType>`
|
**Type**: `list["str" | "bytes" | "complex" | "float" | "int" | "tuple"]`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
@ -3805,7 +3804,7 @@ Maximum number of arguments allowed for a function definition (see: `PLR0913`).
|
||||||
|
|
||||||
**Default value**: `5`
|
**Default value**: `5`
|
||||||
|
|
||||||
**Type**: `usize`
|
**Type**: `int`
|
||||||
|
|
||||||
**Example usage**:
|
**Example usage**:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -768,7 +768,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"docstring-quotes": {
|
"docstring-quotes": {
|
||||||
"description": "Quote style to prefer for docstrings (either \"single\" (`'`) or \"double\" (`\"`)).",
|
"description": "Quote style to prefer for docstrings (either \"single\" or \"double\").",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Quote"
|
"$ref": "#/definitions/Quote"
|
||||||
|
|
@ -779,7 +779,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"inline-quotes": {
|
"inline-quotes": {
|
||||||
"description": "Quote style to prefer for inline strings (either \"single\" (`'`) or \"double\" (`\"`)).",
|
"description": "Quote style to prefer for inline strings (either \"single\" or \"double\").",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Quote"
|
"$ref": "#/definitions/Quote"
|
||||||
|
|
@ -790,7 +790,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"multiline-quotes": {
|
"multiline-quotes": {
|
||||||
"description": "Quote style to prefer for multiline strings (either \"single\" (`'`) or \"double\" (`\"`)).",
|
"description": "Quote style to prefer for multiline strings (either \"single\" or \"double\").",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Quote"
|
"$ref": "#/definitions/Quote"
|
||||||
|
|
@ -1188,14 +1188,14 @@
|
||||||
"Quote": {
|
"Quote": {
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
{
|
{
|
||||||
"description": "Use single quotes (`'`).",
|
"description": "Use single quotes.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"single"
|
"single"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Use double quotes (`\"`).",
|
"description": "Use double quotes.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"double"
|
"double"
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,14 @@ fn default_tmp_dirs() -> Vec<String> {
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = "[\"/tmp\", \"/var/tmp\", \"/dev/shm\"]",
|
default = "[\"/tmp\", \"/var/tmp\", \"/dev/shm\"]",
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = "hardcoded-tmp-directory = [\"/foo/bar\"]"
|
example = "hardcoded-tmp-directory = [\"/foo/bar\"]"
|
||||||
)]
|
)]
|
||||||
/// A list of directories to consider temporary.
|
/// A list of directories to consider temporary.
|
||||||
pub hardcoded_tmp_directory: Option<Vec<String>>,
|
pub hardcoded_tmp_directory: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "[]",
|
default = "[]",
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = "extend-hardcoded-tmp-directory = [\"/foo/bar\"]"
|
example = "extend-hardcoded-tmp-directory = [\"/foo/bar\"]"
|
||||||
)]
|
)]
|
||||||
/// A list of directories to consider temporary, in addition to those
|
/// A list of directories to consider temporary, in addition to those
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
|
# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
|
||||||
extend-immutable-calls = ["fastapi.Depends", "fastapi.Query"]
|
extend-immutable-calls = ["fastapi.Depends", "fastapi.Query"]
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = "builtins-ignorelist = [\"id\"]"
|
example = "builtins-ignorelist = [\"id\"]"
|
||||||
)]
|
)]
|
||||||
/// Ignore list of builtins.
|
/// Ignore list of builtins.
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,7 @@ use serde::{Deserialize, Serialize};
|
||||||
rename = "Flake8ErrMsgOptions"
|
rename = "Flake8ErrMsgOptions"
|
||||||
)]
|
)]
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(default = "0", value_type = "int", example = "max-string-length = 20")]
|
||||||
default = "0",
|
|
||||||
value_type = "usize",
|
|
||||||
example = "max-string-length = 20"
|
|
||||||
)]
|
|
||||||
/// Maximum string length for string literals in exception messages.
|
/// Maximum string length for string literals in exception messages.
|
||||||
pub max_string_length: Option<usize>,
|
pub max_string_length: Option<usize>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ const CONVENTIONAL_ALIASES: &[(&str, &str)] = &[
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"{"altair": "alt", "matplotlib": "mpl", "matplotlib.pyplot": "plt", "numpy": "np", "pandas": "pd", "seaborn": "sns", "tensorflow": "tf", "holoviews": "hv", "panel": "pn", "plotly.express": "px", "polars": "pl", "pyarrow": "pa"}"#,
|
default = r#"{"altair": "alt", "matplotlib": "mpl", "matplotlib.pyplot": "plt", "numpy": "np", "pandas": "pd", "seaborn": "sns", "tensorflow": "tf", "holoviews": "hv", "panel": "pn", "plotly.express": "px", "polars": "pl", "pyarrow": "pa"}"#,
|
||||||
value_type = "FxHashMap<String, String>",
|
value_type = "dict[str, str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
[tool.ruff.flake8-import-conventions.aliases]
|
[tool.ruff.flake8-import-conventions.aliases]
|
||||||
# Declare the default aliases.
|
# Declare the default aliases.
|
||||||
|
|
@ -52,7 +52,7 @@ pub struct Options {
|
||||||
pub aliases: Option<FxHashMap<String, String>>,
|
pub aliases: Option<FxHashMap<String, String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"{}"#,
|
default = r#"{}"#,
|
||||||
value_type = "FxHashMap<String, String>",
|
value_type = "dict[str, str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
[tool.ruff.flake8-import-conventions.extend-aliases]
|
[tool.ruff.flake8-import-conventions.extend-aliases]
|
||||||
# Declare a custom alias for the `matplotlib` module.
|
# Declare a custom alias for the `matplotlib` module.
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ pub struct Options {
|
||||||
pub fixture_parentheses: Option<bool>,
|
pub fixture_parentheses: Option<bool>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "tuple",
|
default = "tuple",
|
||||||
value_type = "ParametrizeNameType",
|
value_type = r#""csv" | "tuple" | "list""#,
|
||||||
example = "parametrize-names-type = \"list\""
|
example = "parametrize-names-type = \"list\""
|
||||||
)]
|
)]
|
||||||
/// Expected type for multiple argument names in `@pytest.mark.parametrize`.
|
/// Expected type for multiple argument names in `@pytest.mark.parametrize`.
|
||||||
|
|
@ -55,7 +55,7 @@ pub struct Options {
|
||||||
pub parametrize_names_type: Option<types::ParametrizeNameType>,
|
pub parametrize_names_type: Option<types::ParametrizeNameType>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "list",
|
default = "list",
|
||||||
value_type = "ParametrizeValuesType",
|
value_type = r#""tuple" | "list""#,
|
||||||
example = "parametrize-values-type = \"tuple\""
|
example = "parametrize-values-type = \"tuple\""
|
||||||
)]
|
)]
|
||||||
/// Expected type for the list of values rows in `@pytest.mark.parametrize`.
|
/// Expected type for the list of values rows in `@pytest.mark.parametrize`.
|
||||||
|
|
@ -65,7 +65,7 @@ pub struct Options {
|
||||||
pub parametrize_values_type: Option<types::ParametrizeValuesType>,
|
pub parametrize_values_type: Option<types::ParametrizeValuesType>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "tuple",
|
default = "tuple",
|
||||||
value_type = "ParametrizeValuesRowType",
|
value_type = r#""tuple" | "list""#,
|
||||||
example = "parametrize-values-row-type = \"list\""
|
example = "parametrize-values-row-type = \"list\""
|
||||||
)]
|
)]
|
||||||
/// Expected type for each row of values in `@pytest.mark.parametrize` in
|
/// Expected type for each row of values in `@pytest.mark.parametrize` in
|
||||||
|
|
@ -77,7 +77,7 @@ pub struct Options {
|
||||||
pub parametrize_values_row_type: Option<types::ParametrizeValuesRowType>,
|
pub parametrize_values_row_type: Option<types::ParametrizeValuesRowType>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"["BaseException", "Exception", "ValueError", "OSError", "IOError", "EnvironmentError", "socket.error"]"#,
|
default = r#"["BaseException", "Exception", "ValueError", "OSError", "IOError", "EnvironmentError", "socket.error"]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = "raises-require-match-for = [\"requests.RequestException\"]"
|
example = "raises-require-match-for = [\"requests.RequestException\"]"
|
||||||
)]
|
)]
|
||||||
/// List of exception names that require a match= parameter in a
|
/// List of exception names that require a match= parameter in a
|
||||||
|
|
@ -85,7 +85,7 @@ pub struct Options {
|
||||||
pub raises_require_match_for: Option<Vec<String>>,
|
pub raises_require_match_for: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "[]",
|
default = "[]",
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = "raises-extend-require-match-for = [\"requests.RequestException\"]"
|
example = "raises-extend-require-match-for = [\"requests.RequestException\"]"
|
||||||
)]
|
)]
|
||||||
/// List of additional exception names that require a match= parameter in a
|
/// List of additional exception names that require a match= parameter in a
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ use serde::{Deserialize, Serialize};
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, JsonSchema)]
|
||||||
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
|
||||||
pub enum Quote {
|
pub enum Quote {
|
||||||
/// Use single quotes (`'`).
|
/// Use single quotes.
|
||||||
Single,
|
Single,
|
||||||
/// Use double quotes (`"`).
|
/// Use double quotes.
|
||||||
Double,
|
Double,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -30,33 +30,32 @@ impl Default for Quote {
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = r#""double""#,
|
default = r#""double""#,
|
||||||
value_type = "Quote",
|
value_type = r#""single" | "double""#,
|
||||||
example = r#"
|
example = r#"
|
||||||
inline-quotes = "single"
|
inline-quotes = "single"
|
||||||
"#
|
"#
|
||||||
)]
|
)]
|
||||||
/// Quote style to prefer for inline strings (either "single" (`'`) or
|
/// Quote style to prefer for inline strings (either "single" or
|
||||||
/// "double" (`"`)).
|
/// "double").
|
||||||
pub inline_quotes: Option<Quote>,
|
pub inline_quotes: Option<Quote>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#""double""#,
|
default = r#""double""#,
|
||||||
value_type = "Quote",
|
value_type = r#""single" | "double""#,
|
||||||
example = r#"
|
example = r#"
|
||||||
multiline-quotes = "single"
|
multiline-quotes = "single"
|
||||||
"#
|
"#
|
||||||
)]
|
)]
|
||||||
/// Quote style to prefer for multiline strings (either "single" (`'`) or
|
/// Quote style to prefer for multiline strings (either "single" or
|
||||||
/// "double" (`"`)).
|
/// "double").
|
||||||
pub multiline_quotes: Option<Quote>,
|
pub multiline_quotes: Option<Quote>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#""double""#,
|
default = r#""double""#,
|
||||||
value_type = "Quote",
|
value_type = r#""single" | "double""#,
|
||||||
example = r#"
|
example = r#"
|
||||||
docstring-quotes = "single"
|
docstring-quotes = "single"
|
||||||
"#
|
"#
|
||||||
)]
|
)]
|
||||||
/// Quote style to prefer for docstrings (either "single" (`'`) or "double"
|
/// Quote style to prefer for docstrings (either "single" or "double").
|
||||||
/// (`"`)).
|
|
||||||
pub docstring_quotes: Option<Quote>,
|
pub docstring_quotes: Option<Quote>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"true"#,
|
default = r#"true"#,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ use super::Settings;
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = r#""parents""#,
|
default = r#""parents""#,
|
||||||
value_type = "Strictness",
|
value_type = r#""parents" | "all""#,
|
||||||
example = r#"
|
example = r#"
|
||||||
# Disallow all relative imports.
|
# Disallow all relative imports.
|
||||||
ban-relative-imports = "all"
|
ban-relative-imports = "all"
|
||||||
|
|
@ -31,7 +31,7 @@ pub struct Options {
|
||||||
pub ban_relative_imports: Option<Strictness>,
|
pub ban_relative_imports: Option<Strictness>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"{}"#,
|
default = r#"{}"#,
|
||||||
value_type = "HashMap<String, BannedApi>",
|
value_type = r#"dict[str, { "msg": str }]"#,
|
||||||
example = r#"
|
example = r#"
|
||||||
[tool.ruff.flake8-tidy-imports.banned-api]
|
[tool.ruff.flake8-tidy-imports.banned-api]
|
||||||
"cgi".msg = "The cgi module is deprecated, see https://peps.python.org/pep-0594/#cgi."
|
"cgi".msg = "The cgi module is deprecated, see https://peps.python.org/pep-0594/#cgi."
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ pub struct Options {
|
||||||
pub strict: Option<bool>,
|
pub strict: Option<bool>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "[\"typing\"]",
|
default = "[\"typing\"]",
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
exempt-modules = ["typing", "typing_extensions"]
|
exempt-modules = ["typing", "typing_extensions"]
|
||||||
"#
|
"#
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ pub struct Options {
|
||||||
pub force_single_line: Option<bool>,
|
pub force_single_line: Option<bool>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
single-line-exclusions = ["os", "json"]
|
single-line-exclusions = ["os", "json"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -120,7 +120,7 @@ pub struct Options {
|
||||||
pub force_sort_within_sections: Option<bool>,
|
pub force_sort_within_sections: Option<bool>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
known-first-party = ["src"]
|
known-first-party = ["src"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -130,7 +130,7 @@ pub struct Options {
|
||||||
pub known_first_party: Option<Vec<String>>,
|
pub known_first_party: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
known-third-party = ["src"]
|
known-third-party = ["src"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -140,7 +140,7 @@ pub struct Options {
|
||||||
pub known_third_party: Option<Vec<String>>,
|
pub known_third_party: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
extra-standard-library = ["path"]
|
extra-standard-library = ["path"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -150,7 +150,7 @@ pub struct Options {
|
||||||
pub extra_standard_library: Option<Vec<String>>,
|
pub extra_standard_library: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"furthest-to-closest"#,
|
default = r#"furthest-to-closest"#,
|
||||||
value_type = "RelativeImportsOrder",
|
value_type = r#""furthest-to-closest" | "closest-to-furthest""#,
|
||||||
example = r#"
|
example = r#"
|
||||||
relative-imports-order = "closest-to-furthest"
|
relative-imports-order = "closest-to-furthest"
|
||||||
"#
|
"#
|
||||||
|
|
@ -166,7 +166,7 @@ pub struct Options {
|
||||||
pub relative_imports_order: Option<RelativeImportsOrder>,
|
pub relative_imports_order: Option<RelativeImportsOrder>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
required-imports = ["from __future__ import annotations"]
|
required-imports = ["from __future__ import annotations"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -175,7 +175,7 @@ pub struct Options {
|
||||||
pub required_imports: Option<Vec<String>>,
|
pub required_imports: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
classes = ["SVC"]
|
classes = ["SVC"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -185,7 +185,7 @@ pub struct Options {
|
||||||
pub classes: Option<Vec<String>>,
|
pub classes: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
constants = ["constant"]
|
constants = ["constant"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -195,7 +195,7 @@ pub struct Options {
|
||||||
pub constants: Option<Vec<String>>,
|
pub constants: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
variables = ["VAR"]
|
variables = ["VAR"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -205,7 +205,7 @@ pub struct Options {
|
||||||
pub variables: Option<Vec<String>>,
|
pub variables: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Option<Vec<ImportType>>",
|
value_type = r#"list["future" | "standard-library" | "third-party" | "first-party" | "local-folder"]"#,
|
||||||
example = r#"
|
example = r#"
|
||||||
no-lines-before = ["future", "standard-library"]
|
no-lines-before = ["future", "standard-library"]
|
||||||
"#
|
"#
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = "10",
|
default = "10",
|
||||||
value_type = "usize",
|
value_type = "int",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Flag errors (`C901`) whenever the complexity level exceeds 5.
|
# Flag errors (`C901`) whenever the complexity level exceeds 5.
|
||||||
max-complexity = 5
|
max-complexity = 5
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ const STATICMETHOD_DECORATORS: [&str; 1] = ["staticmethod"];
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"["setUp", "tearDown", "setUpClass", "tearDownClass", "setUpModule", "tearDownModule", "asyncSetUp", "asyncTearDown", "setUpTestData", "failureException", "longMessage", "maxDiff"]"#,
|
default = r#"["setUp", "tearDown", "setUpClass", "tearDownClass", "setUpModule", "tearDownModule", "asyncSetUp", "asyncTearDown", "setUpTestData", "failureException", "longMessage", "maxDiff"]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
ignore-names = ["callMethod"]
|
ignore-names = ["callMethod"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -43,7 +43,7 @@ pub struct Options {
|
||||||
pub ignore_names: Option<Vec<String>>,
|
pub ignore_names: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"["classmethod"]"#,
|
default = r#"["classmethod"]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Allow Pydantic's `@validator` decorator to trigger class method treatment.
|
# Allow Pydantic's `@validator` decorator to trigger class method treatment.
|
||||||
classmethod-decorators = ["classmethod", "pydantic.validator"]
|
classmethod-decorators = ["classmethod", "pydantic.validator"]
|
||||||
|
|
@ -56,7 +56,7 @@ pub struct Options {
|
||||||
pub classmethod_decorators: Option<Vec<String>>,
|
pub classmethod_decorators: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"["staticmethod"]"#,
|
default = r#"["staticmethod"]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Allow a shorthand alias, `@stcmthd`, to trigger static method treatment.
|
# Allow a shorthand alias, `@stcmthd`, to trigger static method treatment.
|
||||||
staticmethod-decorators = ["staticmethod", "stcmthd"]
|
staticmethod-decorators = ["staticmethod", "stcmthd"]
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = "None",
|
default = "None",
|
||||||
value_type = "usize",
|
value_type = "int",
|
||||||
example = r#"
|
example = r#"
|
||||||
max-doc-length = 88
|
max-doc-length = 88
|
||||||
"#
|
"#
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ impl Convention {
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"None"#,
|
default = r#"None"#,
|
||||||
value_type = "Convention",
|
value_type = r#""google" | "numpy" | "pep257""#,
|
||||||
example = r#"
|
example = r#"
|
||||||
# Use Google-style docstrings.
|
# Use Google-style docstrings.
|
||||||
convention = "google"
|
convention = "google"
|
||||||
|
|
|
||||||
|
|
@ -46,14 +46,14 @@ impl TryFrom<&Constant> for ConstantType {
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"["str", "bytes"]"#,
|
default = r#"["str", "bytes"]"#,
|
||||||
value_type = "Vec<ConstantType>",
|
value_type = r#"list["str" | "bytes" | "complex" | "float" | "int" | "tuple"]"#,
|
||||||
example = r#"
|
example = r#"
|
||||||
allow-magic-value-types = ["int"]
|
allow-magic-value-types = ["int"]
|
||||||
"#
|
"#
|
||||||
)]
|
)]
|
||||||
/// Constant types to ignore when used as "magic values" (see: `PLR2004`).
|
/// Constant types to ignore when used as "magic values" (see: `PLR2004`).
|
||||||
pub allow_magic_value_types: Option<Vec<ConstantType>>,
|
pub allow_magic_value_types: Option<Vec<ConstantType>>,
|
||||||
#[option(default = r"5", value_type = "usize", example = r"max_args = 5")]
|
#[option(default = r"5", value_type = "int", example = r"max_args = 5")]
|
||||||
/// Maximum number of arguments allowed for a function definition (see: `PLR0913`).
|
/// Maximum number of arguments allowed for a function definition (see: `PLR0913`).
|
||||||
pub max_args: Option<usize>,
|
pub max_args: Option<usize>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ use crate::settings::types::{PythonVersion, SerializationFormat, Version};
|
||||||
pub struct Options {
|
pub struct Options {
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<char>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Allow minus-sign (U+2212), greek-small-letter-rho (U+03C1), and the asterisk-operator (U+2217),
|
# Allow minus-sign (U+2212), greek-small-letter-rho (U+03C1), and the asterisk-operator (U+2217),
|
||||||
# which could be confused for "-", "p", and "*", respectively.
|
# which could be confused for "-", "p", and "*", respectively.
|
||||||
|
|
@ -33,7 +33,7 @@ pub struct Options {
|
||||||
pub allowed_confusables: Option<Vec<char>>,
|
pub allowed_confusables: Option<Vec<char>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
builtins = ["_"]
|
builtins = ["_"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -43,7 +43,7 @@ pub struct Options {
|
||||||
pub builtins: Option<Vec<String>>,
|
pub builtins: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = ".ruff_cache",
|
default = ".ruff_cache",
|
||||||
value_type = "PathBuf",
|
value_type = "str",
|
||||||
example = r#"cache-dir = "~/.cache/ruff""#
|
example = r#"cache-dir = "~/.cache/ruff""#
|
||||||
)]
|
)]
|
||||||
/// A path to the cache directory.
|
/// A path to the cache directory.
|
||||||
|
|
@ -59,7 +59,7 @@ pub struct Options {
|
||||||
pub cache_dir: Option<String>,
|
pub cache_dir: Option<String>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#""^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$""#,
|
default = r#""^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$""#,
|
||||||
value_type = "Regex",
|
value_type = "re.Pattern",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Only ignore variables named "_".
|
# Only ignore variables named "_".
|
||||||
dummy-variable-rgx = "^_$"
|
dummy-variable-rgx = "^_$"
|
||||||
|
|
@ -71,7 +71,7 @@ pub struct Options {
|
||||||
pub dummy_variable_rgx: Option<String>,
|
pub dummy_variable_rgx: Option<String>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[".bzr", ".direnv", ".eggs", ".git", ".hg", ".mypy_cache", ".nox", ".pants.d", ".ruff_cache", ".svn", ".tox", ".venv", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", "venv"]"#,
|
default = r#"[".bzr", ".direnv", ".eggs", ".git", ".hg", ".mypy_cache", ".nox", ".pants.d", ".ruff_cache", ".svn", ".tox", ".venv", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", "venv"]"#,
|
||||||
value_type = "Vec<FilePattern>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
exclude = [".venv"]
|
exclude = [".venv"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -95,7 +95,7 @@ pub struct Options {
|
||||||
pub exclude: Option<Vec<String>>,
|
pub exclude: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"None"#,
|
default = r#"None"#,
|
||||||
value_type = "Path",
|
value_type = "str",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Extend the `pyproject.toml` file in the parent directory.
|
# Extend the `pyproject.toml` file in the parent directory.
|
||||||
extend = "../pyproject.toml"
|
extend = "../pyproject.toml"
|
||||||
|
|
@ -113,7 +113,7 @@ pub struct Options {
|
||||||
pub extend: Option<String>,
|
pub extend: Option<String>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "[]",
|
default = "[]",
|
||||||
value_type = "Vec<FilePattern>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# In addition to the standard set of exclusions, omit all tests, plus a specific file.
|
# In addition to the standard set of exclusions, omit all tests, plus a specific file.
|
||||||
extend-exclude = ["tests", "src/bad.py"]
|
extend-exclude = ["tests", "src/bad.py"]
|
||||||
|
|
@ -136,7 +136,7 @@ pub struct Options {
|
||||||
pub extend_exclude: Option<Vec<String>>,
|
pub extend_exclude: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "[]",
|
default = "[]",
|
||||||
value_type = "Vec<RuleSelector>",
|
value_type = "list[RuleSelector]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Skip unused variable rules (`F841`).
|
# Skip unused variable rules (`F841`).
|
||||||
extend-ignore = ["F841"]
|
extend-ignore = ["F841"]
|
||||||
|
|
@ -151,7 +151,7 @@ pub struct Options {
|
||||||
pub extend_ignore: Option<Vec<RuleSelector>>,
|
pub extend_ignore: Option<Vec<RuleSelector>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "[]",
|
default = "[]",
|
||||||
value_type = "Vec<RuleSelector>",
|
value_type = "list[RuleSelector]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# On top of the default `select` (`E`, `F`), enable flake8-bugbear (`B`) and flake8-quotes (`Q`).
|
# On top of the default `select` (`E`, `F`), enable flake8-bugbear (`B`) and flake8-quotes (`Q`).
|
||||||
extend-select = ["B", "Q"]
|
extend-select = ["B", "Q"]
|
||||||
|
|
@ -162,7 +162,7 @@ pub struct Options {
|
||||||
pub extend_select: Option<Vec<RuleSelector>>,
|
pub extend_select: Option<Vec<RuleSelector>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "[]",
|
default = "[]",
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Avoiding flagging (and removing) `V101` from any `# noqa`
|
# Avoiding flagging (and removing) `V101` from any `# noqa`
|
||||||
# directives, despite Ruff's lack of support for `vulture`.
|
# directives, despite Ruff's lack of support for `vulture`.
|
||||||
|
|
@ -183,7 +183,7 @@ pub struct Options {
|
||||||
pub fix_only: Option<bool>,
|
pub fix_only: Option<bool>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"["A", "ANN", "ARG", "B", "BLE", "C", "COM", "D", "DTZ", "E", "EM", "ERA", "EXE", "F", "FBT", "G", "I", "ICN", "INP", "ISC", "N", "PD", "PGH", "PIE", "PL", "PT", "PTH", "Q", "RET", "RUF", "S", "SIM", "T", "TCH", "TID", "TRY", "UP", "W", "YTT"]"#,
|
default = r#"["A", "ANN", "ARG", "B", "BLE", "C", "COM", "D", "DTZ", "E", "EM", "ERA", "EXE", "F", "FBT", "G", "I", "ICN", "INP", "ISC", "N", "PD", "PGH", "PIE", "PL", "PT", "PTH", "Q", "RET", "RUF", "S", "SIM", "T", "TCH", "TID", "TRY", "UP", "W", "YTT"]"#,
|
||||||
value_type = "Vec<RuleSelector>",
|
value_type = "list[RuleSelector]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Only allow autofix behavior for `E` and `F` rules.
|
# Only allow autofix behavior for `E` and `F` rules.
|
||||||
fixable = ["E", "F"]
|
fixable = ["E", "F"]
|
||||||
|
|
@ -194,7 +194,7 @@ pub struct Options {
|
||||||
pub fixable: Option<Vec<RuleSelector>>,
|
pub fixable: Option<Vec<RuleSelector>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#""text""#,
|
default = r#""text""#,
|
||||||
value_type = "SerializationType",
|
value_type = r#""text" | "json" | "junit" | "github" | "gitlab" | "pylint""#,
|
||||||
example = r#"
|
example = r#"
|
||||||
# Group violations by containing file.
|
# Group violations by containing file.
|
||||||
format = "grouped"
|
format = "grouped"
|
||||||
|
|
@ -226,7 +226,7 @@ pub struct Options {
|
||||||
pub force_exclude: Option<bool>,
|
pub force_exclude: Option<bool>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "[]",
|
default = "[]",
|
||||||
value_type = "Vec<RuleSelector>",
|
value_type = "list[RuleSelector]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Skip unused variable rules (`F841`).
|
# Skip unused variable rules (`F841`).
|
||||||
ignore = ["F841"]
|
ignore = ["F841"]
|
||||||
|
|
@ -254,7 +254,7 @@ pub struct Options {
|
||||||
pub ignore_init_module_imports: Option<bool>,
|
pub ignore_init_module_imports: Option<bool>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "88",
|
default = "88",
|
||||||
value_type = "usize",
|
value_type = "int",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Allow lines to be as long as 120 characters.
|
# Allow lines to be as long as 120 characters.
|
||||||
line-length = 120
|
line-length = 120
|
||||||
|
|
@ -265,7 +265,7 @@ pub struct Options {
|
||||||
pub line_length: Option<usize>,
|
pub line_length: Option<usize>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "None",
|
default = "None",
|
||||||
value_type = "String",
|
value_type = "str",
|
||||||
example = r#"
|
example = r#"
|
||||||
required-version = "0.0.193"
|
required-version = "0.0.193"
|
||||||
"#
|
"#
|
||||||
|
|
@ -287,7 +287,7 @@ pub struct Options {
|
||||||
pub respect_gitignore: Option<bool>,
|
pub respect_gitignore: Option<bool>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"["E", "F"]"#,
|
default = r#"["E", "F"]"#,
|
||||||
value_type = "Vec<RuleSelector>",
|
value_type = "list[RuleSelector]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# On top of the defaults (`E`, `F`), enable flake8-bugbear (`B`) and flake8-quotes (`Q`).
|
# On top of the defaults (`E`, `F`), enable flake8-bugbear (`B`) and flake8-quotes (`Q`).
|
||||||
select = ["E", "F", "B", "Q"]
|
select = ["E", "F", "B", "Q"]
|
||||||
|
|
@ -314,7 +314,7 @@ pub struct Options {
|
||||||
pub show_source: Option<bool>,
|
pub show_source: Option<bool>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"["."]"#,
|
default = r#"["."]"#,
|
||||||
value_type = "Vec<PathBuf>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Allow imports relative to the "src" and "test" directories.
|
# Allow imports relative to the "src" and "test" directories.
|
||||||
src = ["src", "test"]
|
src = ["src", "test"]
|
||||||
|
|
@ -347,7 +347,7 @@ pub struct Options {
|
||||||
pub src: Option<Vec<String>>,
|
pub src: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<PathBuf>",
|
value_type = "list[str]",
|
||||||
example = r#"
|
example = r#"
|
||||||
namespace-packages = ["airflow/providers"]
|
namespace-packages = ["airflow/providers"]
|
||||||
"#
|
"#
|
||||||
|
|
@ -358,7 +358,7 @@ pub struct Options {
|
||||||
pub namespace_packages: Option<Vec<String>>,
|
pub namespace_packages: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#""py310""#,
|
default = r#""py310""#,
|
||||||
value_type = "PythonVersion",
|
value_type = r#""py37" | "py38" | "py39" | "py310" | "py311""#,
|
||||||
example = r#"
|
example = r#"
|
||||||
# Always generate Python 3.7-compatible code.
|
# Always generate Python 3.7-compatible code.
|
||||||
target-version = "py37"
|
target-version = "py37"
|
||||||
|
|
@ -371,7 +371,7 @@ pub struct Options {
|
||||||
pub target_version: Option<PythonVersion>,
|
pub target_version: Option<PythonVersion>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"["TODO", "FIXME", "XXX"]"#,
|
default = r#"["TODO", "FIXME", "XXX"]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"task-tags = ["HACK"]"#
|
example = r#"task-tags = ["HACK"]"#
|
||||||
)]
|
)]
|
||||||
/// A list of task tags to recognize (e.g., "TODO", "FIXME", "XXX").
|
/// A list of task tags to recognize (e.g., "TODO", "FIXME", "XXX").
|
||||||
|
|
@ -382,7 +382,7 @@ pub struct Options {
|
||||||
pub task_tags: Option<Vec<String>>,
|
pub task_tags: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = r#"[]"#,
|
default = r#"[]"#,
|
||||||
value_type = "Vec<String>",
|
value_type = "list[str]",
|
||||||
example = r#"typing-modules = ["airflow.typing_compat"]"#
|
example = r#"typing-modules = ["airflow.typing_compat"]"#
|
||||||
)]
|
)]
|
||||||
/// A list of modules whose imports should be treated equivalently to
|
/// A list of modules whose imports should be treated equivalently to
|
||||||
|
|
@ -396,7 +396,7 @@ pub struct Options {
|
||||||
pub typing_modules: Option<Vec<String>>,
|
pub typing_modules: Option<Vec<String>>,
|
||||||
#[option(
|
#[option(
|
||||||
default = "[]",
|
default = "[]",
|
||||||
value_type = "Vec<RuleSelector>",
|
value_type = "list[RuleSelector]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Disable autofix for unused imports (`F401`).
|
# Disable autofix for unused imports (`F401`).
|
||||||
unfixable = ["F401"]
|
unfixable = ["F401"]
|
||||||
|
|
@ -472,7 +472,7 @@ pub struct Options {
|
||||||
// Tables are required to go last.
|
// Tables are required to go last.
|
||||||
#[option(
|
#[option(
|
||||||
default = "{}",
|
default = "{}",
|
||||||
value_type = "HashMap<String, Vec<RuleSelector>>",
|
value_type = "dict[str, list[RuleSelector]]",
|
||||||
example = r#"
|
example = r#"
|
||||||
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
|
# 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]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue