-
Notifications
You must be signed in to change notification settings - Fork 896
/
ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap
113 lines (98 loc) · 3.57 KB
/
ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
source: crates/ruff/src/rules/flake8_bugbear/mod.rs
---
B006_B008.py:63:25: B006 Do not use mutable data structures for argument defaults
|
63 | def this_is_wrong(value=[1, 2, 3]):
| ^^^^^^^^^ B006
64 | ...
|
B006_B008.py:67:30: B006 Do not use mutable data structures for argument defaults
|
67 | def this_is_also_wrong(value={}):
| ^^ B006
68 | ...
|
B006_B008.py:71:20: B006 Do not use mutable data structures for argument defaults
|
71 | def and_this(value=set()):
| ^^^^^ B006
72 | ...
|
B006_B008.py:75:20: B006 Do not use mutable data structures for argument defaults
|
75 | def this_too(value=collections.OrderedDict()):
| ^^^^^^^^^^^^^^^^^^^^^^^^^ B006
76 | ...
|
B006_B008.py:79:32: B006 Do not use mutable data structures for argument defaults
|
79 | async def async_this_too(value=collections.defaultdict()):
| ^^^^^^^^^^^^^^^^^^^^^^^^^ B006
80 | ...
|
B006_B008.py:83:26: B006 Do not use mutable data structures for argument defaults
|
83 | def dont_forget_me(value=collections.deque()):
| ^^^^^^^^^^^^^^^^^^^ B006
84 | ...
|
B006_B008.py:88:46: B006 Do not use mutable data structures for argument defaults
|
88 | # N.B. we're also flagging the function call in the comprehension
89 | def list_comprehension_also_not_okay(default=[i**2 for i in range(3)]):
| ^^^^^^^^^^^^^^^^^^^^^^^^ B006
90 | pass
|
B006_B008.py:92:46: B006 Do not use mutable data structures for argument defaults
|
92 | def dict_comprehension_also_not_okay(default={i: i**2 for i in range(3)}):
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ B006
93 | pass
|
B006_B008.py:96:45: B006 Do not use mutable data structures for argument defaults
|
96 | def set_comprehension_also_not_okay(default={i**2 for i in range(3)}):
| ^^^^^^^^^^^^^^^^^^^^^^^^ B006
97 | pass
|
B006_B008.py:100:33: B006 Do not use mutable data structures for argument defaults
|
100 | def kwonlyargs_mutable(*, value=[]):
| ^^ B006
101 | ...
|
B006_B008.py:218:20: B006 Do not use mutable data structures for argument defaults
|
218 | # B006 and B008
219 | # We should handle arbitrary nesting of these B008.
220 | def nested_combo(a=[float(3), dt.datetime.now()]):
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B006
221 | pass
|
B006_B008.py:251:27: B006 Do not use mutable data structures for argument defaults
|
251 | def mutable_annotations(
252 | a: list[int] | None = [],
| ^^ B006
253 | b: Optional[Dict[int, int]] = {},
254 | c: Annotated[Union[Set[str], abc.Sized], "annotation"] = set(),
|
B006_B008.py:252:35: B006 Do not use mutable data structures for argument defaults
|
252 | def mutable_annotations(
253 | a: list[int] | None = [],
254 | b: Optional[Dict[int, int]] = {},
| ^^ B006
255 | c: Annotated[Union[Set[str], abc.Sized], "annotation"] = set(),
256 | ):
|
B006_B008.py:253:62: B006 Do not use mutable data structures for argument defaults
|
253 | a: list[int] | None = [],
254 | b: Optional[Dict[int, int]] = {},
255 | c: Annotated[Union[Set[str], abc.Sized], "annotation"] = set(),
| ^^^^^ B006
256 | ):
257 | pass
|