From 81b1176f9928ca146f4f6a3ab32804e5fcc00c75 Mon Sep 17 00:00:00 2001 From: Harutaka Kawamura Date: Tue, 15 Aug 2023 21:48:44 +0900 Subject: [PATCH] Fix PT005 doc (#6596) --- .../rules/flake8_pytest_style/rules/fixture.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/ruff/src/rules/flake8_pytest_style/rules/fixture.rs b/crates/ruff/src/rules/flake8_pytest_style/rules/fixture.rs index 771140db95..ddcd51b388 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/rules/fixture.rs +++ b/crates/ruff/src/rules/flake8_pytest_style/rules/fixture.rs @@ -213,6 +213,14 @@ pub struct PytestMissingFixtureNameUnderscore { function: String, } +impl Violation for PytestMissingFixtureNameUnderscore { + #[derive_message_formats] + fn message(&self) -> String { + let PytestMissingFixtureNameUnderscore { function } = self; + format!("Fixture `{function}` does not return anything, add leading underscore") + } +} + /// ## What it does /// Checks for `pytest` fixtures that return a value, but are named with a /// leading underscore. @@ -259,14 +267,6 @@ pub struct PytestMissingFixtureNameUnderscore { /// /// ## References /// - [`pytest` documentation: `@pytest.fixture` functions](https://docs.pytest.org/en/latest/reference/reference.html#pytest-fixture) -impl Violation for PytestMissingFixtureNameUnderscore { - #[derive_message_formats] - fn message(&self) -> String { - let PytestMissingFixtureNameUnderscore { function } = self; - format!("Fixture `{function}` does not return anything, add leading underscore") - } -} - #[violation] pub struct PytestIncorrectFixtureNameUnderscore { function: String,