ruff/crates/ruff_linter
Charlie Marsh c38617fa27
Remove per-diagnostic check for fixability (#7919)
## Summary

Throughout the codebase, we have this pattern:

```rust
let mut diagnostic = ...
if checker.patch(Rule::UnusedVariable) {
    // Do the fix.
}
diagnostics.push(diagnostic)
```

This was helpful when we computed fixes lazily; however, we now compute
fixes eagerly, and this is _only_ used to ensure that we don't generate
fixes for rules marked as unfixable.

We often forget to add this, and it leads to bugs in enforcing
`--unfixable`.

This PR instead removes all of these checks, moving the responsibility
of enforcing `--unfixable` up to `check_path`. This is similar to how
@zanieb handled the `--extend-unsafe` logic: we post-process the
diagnostics to remove any fixes that should be ignored.
2023-10-11 16:09:47 +00:00
..
resources/test [SIM115] Allow open followed by close (#7916) 2023-10-11 13:53:48 +00:00
src Remove per-diagnostic check for fixability (#7919) 2023-10-11 16:09:47 +00:00
Cargo.toml Use crates.io unicode_names2 0.6.0 (#6478) 2023-10-02 18:17:38 -04:00