[`flake8-async`] Make `ASYNC105` example error out-of-the-box (#19002)

## Summary

Part of #18972

This PR makes [trio-sync-call
(ASYNC105)](https://docs.astral.sh/ruff/rules/trio-sync-call/#trio-sync-call-async105)'s
example error out-of-the-box

[Old example](https://play.ruff.rs/5b267e01-1c0a-4902-949e-45fc46f8b0d0)
```py
async def double_sleep(x):
    trio.sleep(2 * x)
```

[New example](https://play.ruff.rs/eba6ea40-ff88-4ea8-8cb4-cea472c15c53)
```py
import trio


async def double_sleep(x):
    trio.sleep(2 * x)
```

## Test Plan

<!-- How was it tested? -->

N/A, no functionality/tests affected
This commit is contained in:
GiGaGon 2025-06-28 08:18:06 -07:00 committed by GitHub
parent 68f98cfcd8
commit c5995c40d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -18,12 +18,18 @@ use crate::{Edit, Fix, FixAvailability, Violation};
/// ///
/// ## Example /// ## Example
/// ```python /// ```python
/// import trio
///
///
/// async def double_sleep(x): /// async def double_sleep(x):
/// trio.sleep(2 * x) /// trio.sleep(2 * x)
/// ``` /// ```
/// ///
/// Use instead: /// Use instead:
/// ```python /// ```python
/// import trio
///
///
/// async def double_sleep(x): /// async def double_sleep(x):
/// await trio.sleep(2 * x) /// await trio.sleep(2 * x)
/// ``` /// ```