mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:15:12 +00:00
Document comment policy around fix safety (#14300)
## Summary Closes https://github.com/astral-sh/ruff/issues/9790.
This commit is contained in:
parent
89aa804b2d
commit
95c8f5fd0f
2 changed files with 15 additions and 5 deletions
|
@ -11,15 +11,21 @@ use crate::edit::Edit;
|
|||
#[cfg_attr(feature = "serde", serde(rename_all = "lowercase"))]
|
||||
pub enum Applicability {
|
||||
/// The fix is unsafe and should only be displayed for manual application by the user.
|
||||
///
|
||||
/// The fix is likely to be incorrect or the resulting code may have invalid syntax.
|
||||
DisplayOnly,
|
||||
|
||||
/// The fix is unsafe and should only be applied with user opt-in.
|
||||
/// The fix may be what the user intended, but it is uncertain; the resulting code will have valid syntax.
|
||||
///
|
||||
/// The fix may be what the user intended, but it is uncertain. The resulting code will have
|
||||
/// valid syntax, but may lead to a change in runtime behavior, the removal of user comments,
|
||||
/// or both.
|
||||
Unsafe,
|
||||
|
||||
/// The fix is safe and can always be applied.
|
||||
/// The fix is definitely what the user intended, or it maintains the exact meaning of the code.
|
||||
///
|
||||
/// The fix is definitely what the user intended, or maintains the exact meaning of the code.
|
||||
/// User comments are preserved, unless the fix removes an entire statement or expression.
|
||||
Safe,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue