mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:22:24 +00:00
[pyflakes
] Add fix safety section to docs (F601
, F602
) (#17440)
## Summary add fix safety section to repeated_keys_docs, for #15584 --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
This commit is contained in:
parent
c550b4d565
commit
fd3fc34a9e
1 changed files with 12 additions and 0 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue