-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Docstring followed by whitespace with no newline | ||
# Regression test for https://github.com/astral-sh/ruff/issues/7155 | ||
|
||
def readLinkagesByLineFile(linkages_file, | ||
column_mapping={ | ||
}): | ||
def foobar(foor, bar={}): | ||
""" | ||
""" | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 17 additions & 19 deletions
36
...rc/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_2.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
--- | ||
source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ||
--- | ||
B006_2.py:4:43: B006 [*] Do not use mutable data structures for argument defaults | ||
B006_2.py:4:22: B006 [*] Do not use mutable data structures for argument defaults | ||
| | ||
3 | def readLinkagesByLineFile(linkages_file, | ||
4 | column_mapping={ | ||
| ___________________________________________^ | ||
5 | | }): | ||
| |____________________________^ B006 | ||
6 | """ | ||
7 | """ | ||
2 | # Regression test for https://github.com/astral-sh/ruff/issues/7155 | ||
3 | | ||
4 | def foobar(foor, bar={}): | ||
| ^^ B006 | ||
5 | """ | ||
6 | """ | ||
| | ||
= help: Replace with `None`; initialize within function | ||
|
||
ℹ Possible fix | ||
1 1 | # Regression test for https://github.com/astral-sh/ruff/issues/7155 | ||
2 2 | | ||
3 3 | def readLinkagesByLineFile(linkages_file, | ||
4 |- column_mapping={ | ||
5 |- }): | ||
4 |+ column_mapping=None): | ||
6 5 | """ | ||
7 |- """ | ||
6 |+ """ | ||
7 |+ if column_mapping is None: | ||
8 |+ column_mapping = {} | ||
1 1 | # Docstring followed by whitespace with no newline | ||
2 2 | # Regression test for https://github.com/astral-sh/ruff/issues/7155 | ||
3 3 | | ||
4 |-def foobar(foor, bar={}): | ||
4 |+def foobar(foor, bar=None): | ||
5 5 | """ | ||
6 |- """ | ||
6 |+ """ | ||
7 |+ if bar is None: | ||
8 |+ bar = {} | ||
|
||
|