diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/rules/runtime_string_union.rs b/crates/ruff_linter/src/rules/flake8_type_checking/rules/runtime_string_union.rs index 2391cbf157..1c103e0db8 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/rules/runtime_string_union.rs +++ b/crates/ruff_linter/src/rules/flake8_type_checking/rules/runtime_string_union.rs @@ -23,17 +23,28 @@ use crate::checkers::ast::Checker; /// /// ## Example /// ```python -/// var: str | "int" +/// var: "Foo" | None +/// +/// +/// class Foo: ... /// ``` /// /// Use instead: /// ```python -/// var: str | int +/// from __future__ import annotations +/// +/// var: Foo | None +/// +/// +/// class Foo: ... /// ``` /// /// Or, extend the quotes to include the entire union: /// ```python -/// var: "str | int" +/// var: "Foo | None" +/// +/// +/// class Foo: ... /// ``` /// /// ## References