mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-27 18:36:35 +00:00
## Summary Part of #18972 This PR makes [blocking-sleep-in-async-function (ASYNC251)](https://docs.astral.sh/ruff/rules/blocking-sleep-in-async-function/#blocking-sleep-in-async-function-async251)'s example error out-of-the-box [Old example](https://play.ruff.rs/796684a2-c437-4390-b754-491e576ffe5e) ```py async def fetch(): time.sleep(1) ``` [New example](https://play.ruff.rs/90741192-fd0d-49fb-a04e-3127312da659) ```py import time async def fetch(): time.sleep(1) ``` Imports were also added to the `Use instead:` section to make it valid code out-of-the-box. ## Test Plan <!-- How was it tested? --> N/A, no functionality/tests affected |
||
|---|---|---|
| .. | ||
| resources | ||
| src | ||
| Cargo.toml | ||