Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TRIO] Add TRIO109 rule #8534

Merged
merged 5 commits into from
Nov 7, 2023

Conversation

karpetrosyan
Copy link
Contributor

Summary

Adds TRIO109 from the flake8-trio plugin.
Relates to: #8451

Copy link
Contributor

github-actions bot commented Nov 7, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+24 -0 violations, +0 -0 fixes in 41 projects)

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

ruff check --no-cache --exit-zero --select ALL --preview

+ airflow/providers/google/cloud/hooks/bigquery_dts.py:325:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/cloud_build.py:649:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/cloud_composer.py:336:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/cloud_composer.py:365:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/cloud_composer.py:393:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataplex.py:900:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1136:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1203:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1246:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1281:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1313:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1353:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1433:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1469:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1515:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1558:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1592:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1628:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1662:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1707:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1741:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/dataproc.py:1777:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/pubsub.py:605:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior
+ airflow/providers/google/cloud/hooks/pubsub.py:659:9: TRIO109 Prefer `trio.fail_after` and `trio.move_on_after` over manual `async` timeout behavior

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
TRIO109 24 24 0 0 0

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@charliermarsh
Copy link
Member

@karpetrosyan - Can you imagine any strategy for narrowing false positives here? For example, could we require that trio has been imported?

@charliermarsh
Copy link
Member

I'm gonna add that heuristic for now.

@charliermarsh charliermarsh merged commit e2c7b1e into astral-sh:main Nov 7, 2023
17 checks passed
@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Nov 7, 2023
@charliermarsh
Copy link
Member

Gonna add in a follow-up.

charliermarsh added a commit that referenced this pull request Nov 7, 2023
## Summary

Hoping to avoid some false positives by narrowing the scope of
#8534.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants