Skip to content

Commit 7defc0d

Browse files
Deprecate PT004 and PT005 (#12837)
Co-authored-by: Alex Waygood <[email protected]>
1 parent 45f459b commit 7defc0d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

crates/ruff_linter/src/codes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,8 +790,8 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
790790
(Flake8PytestStyle, "001") => (RuleGroup::Stable, rules::flake8_pytest_style::rules::PytestFixtureIncorrectParenthesesStyle),
791791
(Flake8PytestStyle, "002") => (RuleGroup::Stable, rules::flake8_pytest_style::rules::PytestFixturePositionalArgs),
792792
(Flake8PytestStyle, "003") => (RuleGroup::Stable, rules::flake8_pytest_style::rules::PytestExtraneousScopeFunction),
793-
(Flake8PytestStyle, "004") => (RuleGroup::Stable, rules::flake8_pytest_style::rules::PytestMissingFixtureNameUnderscore),
794-
(Flake8PytestStyle, "005") => (RuleGroup::Stable, rules::flake8_pytest_style::rules::PytestIncorrectFixtureNameUnderscore),
793+
(Flake8PytestStyle, "004") => (RuleGroup::Deprecated, rules::flake8_pytest_style::rules::PytestMissingFixtureNameUnderscore),
794+
(Flake8PytestStyle, "005") => (RuleGroup::Deprecated, rules::flake8_pytest_style::rules::PytestIncorrectFixtureNameUnderscore),
795795
(Flake8PytestStyle, "006") => (RuleGroup::Stable, rules::flake8_pytest_style::rules::PytestParametrizeNamesWrongType),
796796
(Flake8PytestStyle, "007") => (RuleGroup::Stable, rules::flake8_pytest_style::rules::PytestParametrizeValuesWrongType),
797797
(Flake8PytestStyle, "008") => (RuleGroup::Stable, rules::flake8_pytest_style::rules::PytestPatchWithLambda),

crates/ruff_linter/src/rules/flake8_pytest_style/rules/fixture.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ impl AlwaysFixableViolation for PytestExtraneousScopeFunction {
170170
}
171171
}
172172

173+
/// ## Deprecation
174+
/// Marking fixtures that do not return a value with an underscore
175+
/// isn't a practice recommended by the pytest community.
176+
///
173177
/// ## What it does
174178
/// Checks for `pytest` fixtures that do not return a value, but are not named
175179
/// with a leading underscore.
@@ -227,6 +231,10 @@ impl Violation for PytestMissingFixtureNameUnderscore {
227231
}
228232
}
229233

234+
/// ## Deprecation
235+
/// Marking fixtures that do not return a value with an underscore
236+
/// isn't a practice recommended by the pytest community.
237+
///
230238
/// ## What it does
231239
/// Checks for `pytest` fixtures that return a value, but are named with a
232240
/// leading underscore.

0 commit comments

Comments
 (0)