mirror of
https://github.com/astral-sh/ruff
synced 2026-01-11 08:34:29 -05:00
## Summary This PR adds (unsafe) fixes to the flake8-annotations rules that enforce missing return types, offering to automatically insert type annotations for functions with literal return values. The logic is smart enough to generate simplified unions (e.g., `float` instead of `int | float`) and deal with implicit returns (`return` without a value). Closes https://github.com/astral-sh/ruff/issues/1640 (though we could open a separate issue for referring parameter types). Closes https://github.com/astral-sh/ruff/issues/8213. ## Test Plan `cargo test`