mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 13:51:37 +00:00
Consider nursery rules to be in-preview for ruff rule
(#7812)
## Summary We treat these rules as `preview` elsewhere, so adding `preview: false` to the JSON and such seems like an error. Closes https://github.com/astral-sh/ruff/issues/7804.
This commit is contained in:
parent
bb87f75b0c
commit
a0c846f9bd
1 changed files with 2 additions and 2 deletions
|
@ -35,7 +35,7 @@ impl<'a> Explanation<'a> {
|
||||||
message_formats: rule.message_formats(),
|
message_formats: rule.message_formats(),
|
||||||
fix,
|
fix,
|
||||||
explanation: rule.explanation(),
|
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');
|
output.push('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
if rule.is_preview() {
|
if rule.is_preview() || rule.is_nursery() {
|
||||||
output.push_str(
|
output.push_str(
|
||||||
r#"This rule is in preview and is not stable. The `--preview` flag is required for use."#,
|
r#"This rule is in preview and is not stable. The `--preview` flag is required for use."#,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue