diff --git a/crates/ruff/src/settings/options.rs b/crates/ruff/src/settings/options.rs index 589f35ad32..0a7462cc8f 100644 --- a/crates/ruff/src/settings/options.rs +++ b/crates/ruff/src/settings/options.rs @@ -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, #[option( default = r#"["TODO", "FIXME", "XXX"]"#, diff --git a/ruff.schema.json b/ruff.schema.json index 737f0fdc4a..7076a7c2c5 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -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"