diff --git a/crates/ruff/src/settings/options.rs b/crates/ruff/src/settings/options.rs index 7ed6ae20ac..d7e6c67edf 100644 --- a/crates/ruff/src/settings/options.rs +++ b/crates/ruff/src/settings/options.rs @@ -464,7 +464,11 @@ pub struct Options { "# )] /// The minimum Python version to target, e.g., when considering automatic - /// code upgrades, like rewriting type annotations. + /// code upgrades, like rewriting type annotations. Ruff will not propose + /// changes using features that are not available in the given version. + /// + /// For example, to represent supporting Python >=3.10 or ==3.10 + /// specify `target-version = "py310"`. /// /// If omitted, and Ruff is configured via a `pyproject.toml` file, the /// target version will be inferred from its `project.requires-python` diff --git a/ruff.schema.json b/ruff.schema.json index 9d47d617dc..98c3518fe9 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -560,7 +560,7 @@ ] }, "target-version": { - "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.", + "description": "The minimum Python version to target, e.g., when considering automatic code upgrades, like rewriting type annotations. Ruff will not propose changes using features that are not available in the given version.\n\nFor example, to represent supporting Python >=3.10 or ==3.10 specify `target-version = \"py310\"`.\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"