mirror of https://github.com/astral-sh/ruff
## Summary Implement handling of ellipsis (`...`) defaults in the `FAST002` autofix to correctly differentiate between required and optional parameters in FastAPI route definitions. Previously, the autofix did not properly handle cases where parameters used `...` as a default value (to indicate required parameters). This could lead to incorrect transformations when applying the autofix. This change updates the `FAST002` autofix logic to: - Correctly recognize `...` as a valid FastAPI required default. - Preserve the semantics of required parameters while still applying other autofix improvements. - Avoid incorrectly substituting or removing ellipsis defaults. Fixes https://github.com/astral-sh/ruff/issues/20800 ## Test Plan Added a new test fixture at: ```crates/ruff_linter/resources/test/fixtures/fastapi/FAST002_2.py``` |
||
|---|---|---|
| .. | ||
| fixtures | ||
| package | ||
| project | ||
| __init__.py | ||
| disallowed_rule_names.txt | ||