[ruff] add fix safety section (RUF057) (#17483)
Some checks are pending
CI / test ruff-lsp (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / check playground (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
[Knot Playground] Release / publish (push) Waiting to run

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

View file

@ -27,6 +27,12 @@ use ruff_text_size::Ranged;
/// ```python
/// 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)]
pub(crate) struct UnnecessaryRound;