Skip to content

Conversation

MeGaGiGaGon
Copy link
Contributor

Summary

Part of #18972

This PR makes enumerate-for-loop (SIM113)'s example error out-of-the-box

Old example

fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
    print(f"{i + 1}. {fruit}")
    i += 1

New example

fruits = ["apple", "banana", "cherry"]
i = 0
for fruit in fruits:
    print(f"{i + 1}. {fruit}")
    i += 1

Test Plan

N/A, no functionality/tests affected

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.

@ntBre ntBre added the documentation Improvements or additions to documentation label Jul 3, 2025
@ntBre ntBre merged commit 2589a29 into astral-sh:main Jul 3, 2025
36 checks passed
@MeGaGiGaGon MeGaGiGaGon deleted the patch-6 branch July 3, 2025 14:13
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