Skip to content

Comments

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

Merged
ntBre merged 1 commit intoastral-sh:mainfrom
MeGaGiGaGon:patch-9
Jul 3, 2025
Merged

[flake8-simplify] Make example error out-of-the-box (SIM110)#19113
ntBre merged 1 commit intoastral-sh:mainfrom
MeGaGiGaGon:patch-9

Conversation

@MeGaGiGaGon
Copy link
Contributor

Summary

Part of #18972

This PR makes reimplemented-builtin (SIM110)'s example error out-of-the-box

Old example

for item in iterable:
    if predicate(item):
        return True
return False

New example

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

N/A, no functionality/tests affected

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ntBre ntBre added the documentation Improvements or additions to documentation label Jul 3, 2025
@ntBre ntBre merged commit bf88fee into astral-sh:main Jul 3, 2025
36 checks passed
@MeGaGiGaGon MeGaGiGaGon deleted the patch-9 branch July 3, 2025 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants