mirror of https://github.com/astral-sh/ruff
[`ruff`] Add fix safety section (`RUF028`) (#17722)
The PR add the fix safety section for rule `RUF028` (https://github.com/astral-sh/ruff/issues/15584 ) See also [here](https://github.com/astral-sh/ruff/issues/15584#issuecomment-2820424485) for the reason behind the _unsafe_ of the fix.
This commit is contained in:
parent
0eeb02c0c1
commit
c5e41c278c
|
|
@ -49,6 +49,12 @@ use super::suppression_comment_visitor::{
|
||||||
/// # fmt: on
|
/// # fmt: on
|
||||||
/// # yapf: enable
|
/// # yapf: enable
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// ## Fix safety
|
||||||
|
///
|
||||||
|
/// This fix is always marked as unsafe because it deletes the invalid suppression comment,
|
||||||
|
/// rather than trying to move it to a valid position, which the user more likely intended.
|
||||||
|
///
|
||||||
#[derive(ViolationMetadata)]
|
#[derive(ViolationMetadata)]
|
||||||
pub(crate) struct InvalidFormatterSuppressionComment {
|
pub(crate) struct InvalidFormatterSuppressionComment {
|
||||||
reason: IgnoredReason,
|
reason: IgnoredReason,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue