Commit 315adba
authored
## Summary
Part of astral-sh#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
1 parent 523174e commit 315adba
File tree
1 file changed
+6
-0
lines changed- crates/ruff_linter/src/rules/flake8_async/rules
1 file changed
+6
-0
lines changedLines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| |||
0 commit comments