ruff
7d1b1355 - [`fastapi`] Don't depend on other fixes being applied (`FAST002`) (#29678)

Commit
2 days ago
[`fastapi`] Don't depend on other fixes being applied (`FAST002`) (#29678) Summary -- `ruff check --fix --unsafe-fixes` ends in `Fix introduced a syntax error`. It was seen in the example from ntBre in [#22159] and in the variant from the review, with `noqa` on `d`. The fix removes the default from a parameter, assuming the previous one's default is removed too. If the previous fix is not applied, one parameter stays without a default after one with a default. Now, `seen_default` comes from the source code, in other words, the fix only appears when no previous parameter has a default. The result is that the following parameters are fixed in the next passes of `--fix` and show `Automatic fix is unavailable...` and not `[*]`. Test Plan -- The `handler6` case in `FAST002_0.py`, which fails without the change. [#22159]: https://github.com/astral-sh/ruff/issues/22159#issuecomment-3702360146 --------- Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
Parents
Loading