Files
ruff/crates
Leandro Braga 20d80edfc2 [flake8-bugbear] Mark fix unsafe when it would remove comments (B033) (#22632)
The B033 erroneously removes comments in safe fix.

By running
```console
$ cargo run -p ruff  -- check --select B033 - << 'EOF'
{
  1,
  # comment
  1
}
EOF
```

We get:

# Before

```console
B033 [*] Sets should not contain duplicate item `1`
 --> -:4:3
  |
2 |   1,
3 |   # comment
4 |   1
  |   ^
5 | }
  |
help: Remove duplicate item

Found 1 error.
[*] 1 fixable with the `--fix` option.
```

# After
```console
B033 Sets should not contain duplicate item `1`
 --> -:4:3
  |
2 |   1,
3 |   # comment
4 |   1
  |   ^
5 | }
  |
help: Remove duplicate item

Found 1 error.
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).
```

Closes #22629
2026-01-16 19:07:19 -05:00
..
2026-01-15 12:53:20 -05:00
2026-01-02 19:58:15 +00:00
2026-01-02 19:58:15 +00:00
2026-01-02 19:58:15 +00:00
2026-01-02 19:58:15 +00:00
2026-01-02 19:58:15 +00:00
2026-01-02 19:58:15 +00:00