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:
Charlie Marsh 2023-10-04 11:12:43 -04:00 committed by GitHub
parent bb87f75b0c
commit a0c846f9bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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."#,
);