diff --git a/crates/ruff_linter/src/rules/pyflakes/rules/repeated_keys.rs b/crates/ruff_linter/src/rules/pyflakes/rules/repeated_keys.rs index f29d1dd339..ac71ff477d 100644 --- a/crates/ruff_linter/src/rules/pyflakes/rules/repeated_keys.rs +++ b/crates/ruff_linter/src/rules/pyflakes/rules/repeated_keys.rs @@ -40,6 +40,12 @@ use crate::registry::Rule; /// foo["baz"] # 2 /// ``` /// +/// ## Fix safety +/// +/// This rule's fix is marked as unsafe because removing a repeated dictionary key +/// may delete comments that are attached to the removed key-value pair. This can also change +/// the program's behavior if the value expressions have side effects. +/// /// ## References /// - [Python documentation: Dictionaries](https://docs.python.org/3/tutorial/datastructures.html#dictionaries) #[derive(ViolationMetadata)] @@ -106,6 +112,12 @@ impl Violation for MultiValueRepeatedKeyLiteral { /// foo[baz] # 2 /// ``` /// +/// ## Fix safety +/// +/// This rule's fix is marked as unsafe because removing a repeated dictionary key +/// may delete comments that are attached to the removed key-value pair. This can also change +/// the program's behavior if the value expressions have side effects. +/// /// ## References /// - [Python documentation: Dictionaries](https://docs.python.org/3/tutorial/datastructures.html#dictionaries) #[derive(ViolationMetadata)]