diff --git a/crates/ruff_linter/src/rules/ruff/rules/post_init_default.rs b/crates/ruff_linter/src/rules/ruff/rules/post_init_default.rs index c587a0f7a2..256e650e68 100644 --- a/crates/ruff_linter/src/rules/ruff/rules/post_init_default.rs +++ b/crates/ruff_linter/src/rules/ruff/rules/post_init_default.rs @@ -61,6 +61,12 @@ use super::helpers::{dataclass_kind, DataclassKind}; /// foo = Foo() # Prints '1 2'. /// ``` /// +/// ## Fix safety +/// +/// This fix is always marked as unsafe because, although switching to `InitVar` is usually correct, +/// it is incorrect when the parameter is not intended to be part of the public API or when the value +/// is meant to be shared across all instances. +/// /// ## References /// - [Python documentation: Post-init processing](https://docs.python.org/3/library/dataclasses.html#post-init-processing) /// - [Python documentation: Init-only variables](https://docs.python.org/3/library/dataclasses.html#init-only-variables)