From b2d3a05ee4d6b9f984a33ea551e35ea8d6cbc990 Mon Sep 17 00:00:00 2001 From: Auguste Lalande Date: Mon, 22 Jul 2024 19:38:13 -0400 Subject: [PATCH] [`flake8-async`] Fix references in documentation not displaying (#12467) ## Summary Fix references in documentation of several `ASYNC` rules not displaying ## Test Plan Validated documentation now displays correctly --- .../src/rules/flake8_async/rules/async_busy_wait.rs | 7 ++++--- .../flake8_async/rules/async_function_with_timeout.rs | 7 ++++--- .../rules/flake8_async/rules/cancel_scope_no_checkpoint.rs | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/crates/ruff_linter/src/rules/flake8_async/rules/async_busy_wait.rs b/crates/ruff_linter/src/rules/flake8_async/rules/async_busy_wait.rs index 0254c23868..fdf610249c 100644 --- a/crates/ruff_linter/src/rules/flake8_async/rules/async_busy_wait.rs +++ b/crates/ruff_linter/src/rules/flake8_async/rules/async_busy_wait.rs @@ -34,9 +34,10 @@ use crate::settings::types::PreviewMode; /// await DONE.wait() /// ``` /// -/// [`asyncio` events]: https://docs.python.org/3/library/asyncio-sync.html#asyncio.Event -/// [`anyio` events]: https://trio.readthedocs.io/en/latest/reference-core.html#trio.Event -/// [`trio` events]: https://anyio.readthedocs.io/en/latest/api.html#anyio.Event +/// ## References +/// - [`asyncio` events](https://docs.python.org/3/library/asyncio-sync.html#asyncio.Event) +/// - [`anyio` events](https://trio.readthedocs.io/en/latest/reference-core.html#trio.Event) +/// - [`trio` events](https://anyio.readthedocs.io/en/latest/api.html#anyio.Event) #[violation] pub struct AsyncBusyWait { module: AsyncModule, diff --git a/crates/ruff_linter/src/rules/flake8_async/rules/async_function_with_timeout.rs b/crates/ruff_linter/src/rules/flake8_async/rules/async_function_with_timeout.rs index 26bea156b7..2edc094fc6 100644 --- a/crates/ruff_linter/src/rules/flake8_async/rules/async_function_with_timeout.rs +++ b/crates/ruff_linter/src/rules/flake8_async/rules/async_function_with_timeout.rs @@ -37,9 +37,10 @@ use crate::settings::types::PreviewMode; /// await long_running_task() /// ``` /// -/// [`asyncio` timeouts]: https://docs.python.org/3/library/asyncio-task.html#timeouts -/// [`anyio` timeouts]: https://anyio.readthedocs.io/en/stable/cancellation.html -/// [`trio` timeouts]: https://trio.readthedocs.io/en/stable/reference-core.html#cancellation-and-timeouts +/// ## References +/// - [`asyncio` timeouts](https://docs.python.org/3/library/asyncio-task.html#timeouts) +/// - [`anyio` timeouts](https://anyio.readthedocs.io/en/stable/cancellation.html) +/// - [`trio` timeouts](https://trio.readthedocs.io/en/stable/reference-core.html#cancellation-and-timeouts) #[violation] pub struct AsyncFunctionWithTimeout { module: AsyncModule, diff --git a/crates/ruff_linter/src/rules/flake8_async/rules/cancel_scope_no_checkpoint.rs b/crates/ruff_linter/src/rules/flake8_async/rules/cancel_scope_no_checkpoint.rs index 8495bd90cb..2037710446 100644 --- a/crates/ruff_linter/src/rules/flake8_async/rules/cancel_scope_no_checkpoint.rs +++ b/crates/ruff_linter/src/rules/flake8_async/rules/cancel_scope_no_checkpoint.rs @@ -32,9 +32,10 @@ use crate::settings::types::PreviewMode; /// await awaitable() /// ``` /// -/// [`asyncio` timeouts]: https://docs.python.org/3/library/asyncio-task.html#timeouts -/// [`anyio` timeouts]: https://anyio.readthedocs.io/en/stable/cancellation.html -/// [`trio` timeouts]: https://trio.readthedocs.io/en/stable/reference-core.html#cancellation-and-timeouts +/// ## References +/// - [`asyncio` timeouts](https://docs.python.org/3/library/asyncio-task.html#timeouts) +/// - [`anyio` timeouts](https://anyio.readthedocs.io/en/stable/cancellation.html) +/// - [`trio` timeouts](https://trio.readthedocs.io/en/stable/reference-core.html#cancellation-and-timeouts) #[violation] pub struct CancelScopeNoCheckpoint { method_name: MethodName,