From 528f386131556d25b39f9ba639d24555cda4fb3d Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 26 Sep 2023 17:53:29 -0500 Subject: [PATCH] Show preview notice on rule pages for nursery rules (#7670) ## Summary The note about rules being in preview was not being displayed for legacy nursery rules. Adds a link to the new preview documentation as well. ## Test Plan Built locally and checked a nursery rule e.g. http://127.0.0.1:8000/ruff/rules/no-indented-block-comment/ --- crates/ruff_dev/src/generate_docs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruff_dev/src/generate_docs.rs b/crates/ruff_dev/src/generate_docs.rs index b6b70c7f4e..fe595ebf3c 100644 --- a/crates/ruff_dev/src/generate_docs.rs +++ b/crates/ruff_dev/src/generate_docs.rs @@ -44,9 +44,9 @@ pub(crate) fn main(args: &Args) -> Result<()> { output.push('\n'); } - if rule.is_preview() { + if rule.is_preview() || rule.is_nursery() { output.push_str( - r#"This rule is in preview and is not stable. The `--preview` flag is required for use."#, + r#"This rule is unstable and in [preview](../preview.md). The `--preview` flag is required for use."#, ); output.push('\n'); output.push('\n');