Skip to content

Ignore list-copy recommendations for async for loops#11250

Merged
charliermarsh merged 1 commit intomainfrom
charlie/async
May 2, 2024
Merged

Ignore list-copy recommendations for async for loops#11250
charliermarsh merged 1 commit intomainfrom
charlie/async

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Summary

Removes these from PERF402, but adds them to PERF401, with a custom message to use an async comprehension.

Closes #10787.

@zanieb
Copy link
Copy Markdown
Member

zanieb commented May 2, 2024

Nice!

@charliermarsh charliermarsh merged commit 3a7c01b into main May 2, 2024
@charliermarsh charliermarsh deleted the charlie/async branch May 2, 2024 18:48
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 2, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+2 -2 violations, +0 -0 fixes in 1 projects; 43 projects unchanged)

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

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

+ airflow/providers/microsoft/azure/hooks/wasb.py:690:13: PERF401 Use an async list comprehension to create a transformed list
- airflow/providers/microsoft/azure/hooks/wasb.py:690:13: PERF402 Use `list` or `list.copy` to create a copy of a list
+ tests/providers/microsoft/azure/base.py:55:13: PERF401 Use an async list comprehension to create a transformed list
- tests/providers/microsoft/azure/base.py:55:13: PERF402 Use `list` or `list.copy` to create a copy of a list

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
PERF401 2 2 0 0 0
PERF402 2 0 2 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+2 -2 violations, +0 -0 fixes in 1 projects; 43 projects unchanged)

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

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

+ airflow/providers/microsoft/azure/hooks/wasb.py:690:13: PERF401 Use an async list comprehension to create a transformed list
- airflow/providers/microsoft/azure/hooks/wasb.py:690:13: PERF402 Use `list` or `list.copy` to create a copy of a list
+ tests/providers/microsoft/azure/base.py:55:13: PERF401 Use an async list comprehension to create a transformed list
- tests/providers/microsoft/azure/base.py:55:13: PERF402 Use `list` or `list.copy` to create a copy of a list

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
PERF401 2 2 0 0 0
PERF402 2 0 2 0 0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PERF402 triggers, incorrectly, on async for loops

2 participants