[`ruff`] add fix safety section (`RUF057`) (#17483)

The PR add the `fix safety` section for rule `RUF057` (#15584 )
This commit is contained in:
Vasco Schiavo 2025-04-26 13:58:52 +02:00 committed by GitHub
parent 6044f04137
commit 4bcf1778fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,12 @@ use ruff_text_size::Ranged;
/// ```python /// ```python
/// a = 1 /// a = 1
/// ``` /// ```
///
/// ## Fix safety
///
/// The fix is marked unsafe if it is not possible to guarantee that the first argument of
/// `round()` is of type `int`, or if the fix deletes comments.
///
#[derive(ViolationMetadata)] #[derive(ViolationMetadata)]
pub(crate) struct UnnecessaryRound; pub(crate) struct UnnecessaryRound;