Clarify requires-python inference requirements (#4918)
This commit is contained in:
@@ -436,12 +436,13 @@ pub struct Options {
|
||||
target-version = "py37"
|
||||
"#
|
||||
)]
|
||||
/// The Python version to target, e.g., when considering automatic code
|
||||
/// upgrades, like rewriting type annotations.
|
||||
/// The minimum Python version to target, e.g., when considering automatic
|
||||
/// code upgrades, like rewriting type annotations.
|
||||
///
|
||||
/// If omitted, the target version will be inferred from the
|
||||
/// `project.requires-python` field in the relevant `pyproject.toml`
|
||||
/// (e.g., `requires-python = ">=3.8"`), if present.
|
||||
/// If omitted, and Ruff is configured via a `pyproject.toml` file, the
|
||||
/// target version will be inferred from its `project.requires-python`
|
||||
/// field (e.g., `requires-python = ">=3.8"`). If Ruff is configured via
|
||||
/// `ruff.toml` or `.ruff.toml`, no such inference will be performed.
|
||||
pub target_version: Option<PythonVersion>,
|
||||
#[option(
|
||||
default = r#"["TODO", "FIXME", "XXX"]"#,
|
||||
|
||||
2
ruff.schema.json
generated
2
ruff.schema.json
generated
@@ -528,7 +528,7 @@
|
||||
]
|
||||
},
|
||||
"target-version": {
|
||||
"description": "The Python version to target, e.g., when considering automatic code upgrades, like rewriting type annotations.\n\nIf omitted, the target version will be inferred from the `project.requires-python` field in the relevant `pyproject.toml` (e.g., `requires-python = \">=3.8\"`), if present.",
|
||||
"description": "The minimum Python version to target, e.g., when considering automatic code upgrades, like rewriting type annotations.\n\nIf omitted, and Ruff is configured via a `pyproject.toml` file, the target version will be inferred from its `project.requires-python` field (e.g., `requires-python = \">=3.8\"`). If Ruff is configured via `ruff.toml` or `.ruff.toml`, no such inference will be performed.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/PythonVersion"
|
||||
|
||||
Reference in New Issue
Block a user