Skip to content

Detect enumerate iterations in loop-iterator-mutation#12366

Merged
charliermarsh merged 1 commit intomainfrom
charlie/B9
Jul 17, 2024
Merged

Detect enumerate iterations in loop-iterator-mutation#12366
charliermarsh merged 1 commit intomainfrom
charlie/B9

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Summary

Closes #12164.

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Jul 17, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 17, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+5 -0 violations, +0 -0 fixes in 4 projects; 50 projects unchanged)

apache/airflow (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ airflow/utils/cli.py:150:17: B909 Mutation to loop iterable `full_command` during iteration

python/mypy (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ mypy/typeops.py:949:21: B909 Mutation to loop iterable `proper_types` during iteration

zulip/zulip (+2 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ zerver/lib/markdown/nested_code_blocks.py:82:17: B909 Mutation to loop iterable `parent` during iteration
+ zerver/lib/markdown/nested_code_blocks.py:83:17: B909 Mutation to loop iterable `parent` during iteration

pytest-dev/pytest (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ scripts/release.py:54:17: B909 Mutation to loop iterable `lines` during iteration

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
B909 5 5 0 0 0

@charliermarsh
Copy link
Copy Markdown
Member Author

I need to allow assignments to the current key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rule B909 (loop-iterator-mutation) doesn't detect many kinds of list mutation

1 participant