|
1 | 1 | --- |
2 | 2 | source: crates/ruff/src/rules/ruff/mod.rs |
3 | 3 | --- |
4 | | -RUF009.py:15:41: RUF009 Do not perform function call `default_function` in dataclass defaults |
| 4 | +RUF009.py:16:41: RUF009 Do not perform function call `default_function` in dataclass defaults |
5 | 5 | | |
6 | | -15 | @dataclass() |
7 | | -16 | class A: |
8 | | -17 | hidden_mutable_default: list[int] = default_function() |
| 6 | +16 | @dataclass() |
| 7 | +17 | class A: |
| 8 | +18 | hidden_mutable_default: list[int] = default_function() |
9 | 9 | | ^^^^^^^^^^^^^^^^^^ RUF009 |
| 10 | +19 | class_variable: typing.ClassVar[list[int]] = default_function() |
| 11 | +20 | another_class_var: ClassVar[list[int]] = default_function() |
10 | 12 | | |
11 | 13 |
|
12 | | -RUF009.py:24:41: RUF009 Do not perform function call `default_function` in dataclass defaults |
| 14 | +RUF009.py:27:41: RUF009 Do not perform function call `default_function` in dataclass defaults |
13 | 15 | | |
14 | | -24 | @dataclass |
15 | | -25 | class B: |
16 | | -26 | hidden_mutable_default: list[int] = default_function() |
| 16 | +27 | @dataclass |
| 17 | +28 | class B: |
| 18 | +29 | hidden_mutable_default: list[int] = default_function() |
17 | 19 | | ^^^^^^^^^^^^^^^^^^ RUF009 |
18 | | -27 | another_dataclass: A = A() |
19 | | -28 | not_optimal: ImmutableType = ImmutableType(20) |
| 20 | +30 | another_dataclass: A = A() |
| 21 | +31 | not_optimal: ImmutableType = ImmutableType(20) |
20 | 22 | | |
21 | 23 |
|
22 | | -RUF009.py:25:28: RUF009 Do not perform function call `A` in dataclass defaults |
| 24 | +RUF009.py:28:28: RUF009 Do not perform function call `A` in dataclass defaults |
23 | 25 | | |
24 | | -25 | class B: |
25 | | -26 | hidden_mutable_default: list[int] = default_function() |
26 | | -27 | another_dataclass: A = A() |
| 26 | +28 | class B: |
| 27 | +29 | hidden_mutable_default: list[int] = default_function() |
| 28 | +30 | another_dataclass: A = A() |
27 | 29 | | ^^^ RUF009 |
28 | | -28 | not_optimal: ImmutableType = ImmutableType(20) |
29 | | -29 | good_variant: ImmutableType = DEFAULT_IMMUTABLETYPE_FOR_ALL_DATACLASSES |
| 30 | +31 | not_optimal: ImmutableType = ImmutableType(20) |
| 31 | +32 | good_variant: ImmutableType = DEFAULT_IMMUTABLETYPE_FOR_ALL_DATACLASSES |
30 | 32 | | |
31 | 33 |
|
32 | | -RUF009.py:26:34: RUF009 Do not perform function call `ImmutableType` in dataclass defaults |
| 34 | +RUF009.py:29:34: RUF009 Do not perform function call `ImmutableType` in dataclass defaults |
33 | 35 | | |
34 | | -26 | hidden_mutable_default: list[int] = default_function() |
35 | | -27 | another_dataclass: A = A() |
36 | | -28 | not_optimal: ImmutableType = ImmutableType(20) |
| 36 | +29 | hidden_mutable_default: list[int] = default_function() |
| 37 | +30 | another_dataclass: A = A() |
| 38 | +31 | not_optimal: ImmutableType = ImmutableType(20) |
37 | 39 | | ^^^^^^^^^^^^^^^^^ RUF009 |
38 | | -29 | good_variant: ImmutableType = DEFAULT_IMMUTABLETYPE_FOR_ALL_DATACLASSES |
39 | | -30 | okay_variant: A = DEFAULT_A_FOR_ALL_DATACLASSES |
| 40 | +32 | good_variant: ImmutableType = DEFAULT_IMMUTABLETYPE_FOR_ALL_DATACLASSES |
| 41 | +33 | okay_variant: A = DEFAULT_A_FOR_ALL_DATACLASSES |
40 | 42 | | |
41 | 43 |
|
42 | 44 |
|
0 commit comments