ruff
bf88fee4 - [`flake8-simplify`] Make example error out-of-the-box (`SIM110`) (#19113)

Commit
73 days ago
[`flake8-simplify`] Make example error out-of-the-box (`SIM110`) (#19113) <!-- Thank you for contributing to Ruff/ty! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? (Please prefix with `[ty]` for ty pull requests.) - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> Part of #18972 This PR makes [reimplemented-builtin (SIM110)](https://docs.astral.sh/ruff/rules/reimplemented-builtin/#reimplemented-builtin-sim110)'s example error out-of-the-box [Old example](https://play.ruff.rs/1c192e8b-13f8-4f07-8c35-9dcd516a4a02) ```py for item in iterable: if predicate(item): return True return False ``` [New example](https://play.ruff.rs/f77393ad-20b1-436f-a872-d3bccec7c829) ```py def foo(): for item in iterable: if predicate(item): return True return False ``` The "Use instead" section was also updated to reflect the change. ## Test Plan <!-- How was it tested? --> N/A, no functionality/tests affected
Author
Parents
Loading