Skip to content

Commit

Permalink
Consider nursery rules to be in-preview for ruff rule (#7812)
Browse files Browse the repository at this point in the history
## Summary

We treat these rules as `preview` elsewhere, so adding `preview: false`
to the JSON and such seems like an error.

Closes #7804.
  • Loading branch information
charliermarsh committed Oct 4, 2023
1 parent bb87f75 commit a0c846f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/ruff_cli/src/commands/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
}
Expand All @@ -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."#,
);
Expand Down

0 comments on commit a0c846f

Please sign in to comment.