ruff
bf2cc3f5 - Add autotyping-like return type inference for annotation rules (#8643)

Commit
2 years ago
Add autotyping-like return type inference for annotation rules (#8643) ## 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`
Author
Parents
Loading