Skip to content

[flake8-comprehensions] Skip iterables with named expressions in unnecessary-map (C417)#14827

Merged
charliermarsh merged 5 commits intoastral-sh:mainfrom
dylwil3:walrus-compr
Dec 7, 2024
Merged

[flake8-comprehensions] Skip iterables with named expressions in unnecessary-map (C417)#14827
charliermarsh merged 5 commits intoastral-sh:mainfrom
dylwil3:walrus-compr

Conversation

@dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Dec 6, 2024

This PR modifies unnecessary-map (C417) to skip map expressions if the iterable contains a named expression, since those cannot appear in comprehensions.

Closes #14808

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh charliermarsh added the bug Something isn't working label Dec 7, 2024
@charliermarsh charliermarsh changed the title [flake8-comprehensions] Skip iterables with named expressions in unnecessary-map (C417)` [flake8-comprehensions] Skip iterables with named expressions in unnecessary-map (C417) Dec 7, 2024
@charliermarsh charliermarsh changed the title [flake8-comprehensions] Skip iterables with named expressions in unnecessary-map (C417) [flake8-comprehensions] Skip iterables with named expressions in unnecessary-map (C417) Dec 7, 2024
@charliermarsh charliermarsh merged commit 2c13e65 into astral-sh:main Dec 7, 2024
@dylwil3 dylwil3 deleted the walrus-compr branch December 7, 2024 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix error] C417 and walrus statements

2 participants