From 367b3d150ee0abd8aabd105566507ef4a6e68107 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 4 Oct 2023 09:46:25 -0400 Subject: [PATCH] Consider nursery rules to be in-preview for ruff rule --- crates/ruff_cli/src/commands/rule.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruff_cli/src/commands/rule.rs b/crates/ruff_cli/src/commands/rule.rs index 9763af53d5ce3..8df1eacb1ec2f 100644 --- a/crates/ruff_cli/src/commands/rule.rs +++ b/crates/ruff_cli/src/commands/rule.rs @@ -35,7 +35,7 @@ impl<'a> Explanation<'a> { message_formats: rule.message_formats(), fix, explanation: rule.explanation(), - preview: rule.is_preview(), + preview: rule.is_preview() || rule.is_nursery(), } } } @@ -61,7 +61,7 @@ fn format_rule_text(rule: Rule) -> String { 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."#, );