Swap the order of nursery and preview rules

This commit is contained in:
Zanie 2023-09-13 15:49:55 -05:00
parent 97654a9911
commit 595207b853
2 changed files with 16 additions and 8 deletions

View File

@ -868,10 +868,10 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
#[cfg(feature = "test-rules")]
(Ruff, "900") => (RuleGroup::Unspecified, rules::ruff::rules::StableTestRule),
#[cfg(feature = "test-rules")]
#[allow(deprecated)]
(Ruff, "901") => (RuleGroup::Nursery, rules::ruff::rules::NurseryTestRule),
(Ruff, "901") => (RuleGroup::Preview, rules::ruff::rules::PreviewTestRule),
#[cfg(feature = "test-rules")]
(Ruff, "902") => (RuleGroup::Preview, rules::ruff::rules::PreviewTestRule),
#[allow(deprecated)]
(Ruff, "902") => (RuleGroup::Nursery, rules::ruff::rules::NurseryTestRule),
// flake8-django
(Flake8Django, "001") => (RuleGroup::Unspecified, rules::flake8_django::rules::DjangoNullableModelStringField),

View File

@ -278,7 +278,8 @@ fn nursery_all() {
----- stdout -----
-:1:1: E741 Ambiguous variable name: `I`
-:1:1: D100 Missing docstring in public module
Found 2 errors.
-:1:1: RUF900 Hey this is a stable test rule.
Found 3 errors.
----- stderr -----
warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.
@ -317,8 +318,9 @@ fn nursery_group_selector() {
exit_code: 1
----- stdout -----
-:1:1: CPY001 Missing copyright notice at top of file
-:1:1: RUF902 Hey this is a nursery test rule.
-:1:2: E225 Missing whitespace around operator
Found 2 errors.
Found 3 errors.
----- stderr -----
warning: The `NURSERY` selector has been deprecated. Use the `--preview` flag instead.
@ -337,8 +339,9 @@ fn nursery_group_selector_preview_enabled() {
exit_code: 1
----- stdout -----
-:1:1: CPY001 Missing copyright notice at top of file
-:1:1: RUF902 Hey this is a nursery test rule.
-:1:2: E225 Missing whitespace around operator
Found 2 errors.
Found 3 errors.
----- stderr -----
warning: The `NURSERY` selector has been deprecated. Use the `PREVIEW` selector instead.
@ -377,8 +380,11 @@ fn preview_enabled_all() {
-:1:1: E741 Ambiguous variable name: `I`
-:1:1: D100 Missing docstring in public module
-:1:1: CPY001 Missing copyright notice at top of file
-:1:1: RUF900 Hey this is a stable test rule.
-:1:1: RUF901 Hey this is a preview test rule.
-:1:1: RUF902 Hey this is a nursery test rule.
-:1:2: E225 Missing whitespace around operator
Found 4 errors.
Found 7 errors.
----- stderr -----
warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible. Ignoring `one-blank-line-before-class`.
@ -467,8 +473,10 @@ fn preview_enabled_group_selector() {
exit_code: 1
----- stdout -----
-:1:1: CPY001 Missing copyright notice at top of file
-:1:1: RUF901 Hey this is a preview test rule.
-:1:1: RUF902 Hey this is a nursery test rule.
-:1:2: E225 Missing whitespace around operator
Found 2 errors.
Found 4 errors.
----- stderr -----
"###);