Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion crates/ruff_linter/src/rules/ruff/rules/unused_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ use crate::rules::fastapi::rules::is_fastapi_route;
/// ## Why is this bad?
/// Declaring a function `async` when it's not is usually a mistake, and will artificially limit the
/// contexts where that function may be called. In some cases, labeling a function `async` is
/// semantically meaningful (e.g. with the trio library).
/// semantically meaningful. For example, an async test or callback may need to run in an async
/// execution context, even if it only uses a `ContextVar`.
///
/// If the async context is intentional, add an actual await expression, such as
/// `await asyncio.sleep(0)`, or disable this rule for the function.
///
/// ## Example
/// ```python
Expand Down
Loading