diff --git a/crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B006_6.py b/crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B006_6.py index 5cf88370a46dd..b651380f0def1 100644 --- a/crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B006_6.py +++ b/crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B006_6.py @@ -1,5 +1,5 @@ -# Docstring followed by whitespace with no newline -# Regression test for https://github.com/astral-sh/ruff/issues/7155 +# Import followed by whitespace with no newline +# Same as B006_2.py, but import instead of docstring def foobar(foor, bar={}): import os \ No newline at end of file diff --git a/crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B006_7.py b/crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B006_7.py index dbe6cf7e17794..0b382b5fbfcf9 100644 --- a/crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B006_7.py +++ b/crates/ruff_linter/resources/test/fixtures/flake8_bugbear/B006_7.py @@ -1,5 +1,5 @@ -# Docstring with no newline - +# Import with no newline +# Same as B006_3.py, but import instead of docstring def foobar(foor, bar={}): import os \ No newline at end of file diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_6.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_6.py.snap index e3fd873bc7082..f1af067d82f64 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_6.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_6.py.snap @@ -3,7 +3,7 @@ source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs --- B006_6.py:4:22: B006 [*] Do not use mutable data structures for argument defaults | -2 | # Regression test for https://github.com/astral-sh/ruff/issues/7155 +2 | # Same as B006_2.py, but import instead of docstring 3 | 4 | def foobar(foor, bar={}): | ^^ B006 @@ -12,8 +12,8 @@ B006_6.py:4:22: B006 [*] Do not use mutable data structures for argument default = help: Replace with `None`; initialize within function ℹ Possible fix -1 1 | # Docstring followed by whitespace with no newline -2 2 | # Regression test for https://github.com/astral-sh/ruff/issues/7155 +1 1 | # Import followed by whitespace with no newline +2 2 | # Same as B006_2.py, but import instead of docstring 3 3 | 4 |-def foobar(foor, bar={}): 5 |- import os diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_7.py.snap b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_7.py.snap index 484e6987d91b1..fbe42a7285e85 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_7.py.snap +++ b/crates/ruff_linter/src/rules/flake8_bugbear/snapshots/ruff_linter__rules__flake8_bugbear__tests__B006_B006_7.py.snap @@ -3,6 +3,8 @@ source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs --- B006_7.py:4:22: B006 [*] Do not use mutable data structures for argument defaults | +2 | # Same as B006_3.py, but import instead of docstring +3 | 4 | def foobar(foor, bar={}): | ^^ B006 5 | import os @@ -10,8 +12,8 @@ B006_7.py:4:22: B006 [*] Do not use mutable data structures for argument default = help: Replace with `None`; initialize within function ℹ Possible fix -1 1 | # Docstring with no newline -2 2 | +1 1 | # Import with no newline +2 2 | # Same as B006_3.py, but import instead of docstring 3 3 | 4 |-def foobar(foor, bar={}): 5 |- import os