ruff
ruff copied to clipboard
[`ruff`] Implement missing `await` for coroutine (`RUF028`)
Summary
Detect never-awaited coroutines
This rule only applies to simple scenarios. We need to be quite conservative on how to handle coroutines. Because there are many situations in which the programmer does not want to evaluate/await a coroutine but instead use the actual coroutine object.
Closes https://github.com/astral-sh/ruff/issues/9833
Test Plan
cargo test
ruff-ecosystem results
Linter (stable)
✅ ecosystem check detected no linter changes.
Linter (preview)
✅ ecosystem check detected no linter changes.
CodSpeed Performance Report
Merging #9911 will not alter performance
Comparing mikeleppane:rule(RUF028)/detect-unused-await (0275ffd) with main (8ec5627)
Summary
✅ 30 untouched benchmarks
Thanks for contributing!
It looks like the ecosystem checks are showing some false positives e.g. https://github.com/apache/airflow/blob/48bfb1a970f5b47ba1b385ad809b8324923ddf3e/tests/providers/google/cloud/hooks/test_dataflow.py#L1956 — could you look into those?
Thanks for contributing!
It looks like the ecosystem checks are showing some false positives e.g. https://github.com/apache/airflow/blob/48bfb1a970f5b47ba1b385ad809b8324923ddf3e/tests/providers/google/cloud/hooks/test_dataflow.py#L1956 — could you look into those?
Thanks! Good catch.
This rule fits into ruff as a suspicious rule. I think we should rename the rule to never-awaited-coroutines so that allow(never-awaited-coroutines) reads better.
Hi, any update on when this will be released?