-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
1 parent
7504bf3
commit 009430e
Showing
5 changed files
with
84 additions
and
49 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
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
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
98 changes: 54 additions & 44 deletions
98
...ff_linter/src/rules/ruff/snapshots/ruff_linter__rules__ruff__tests__RUF011_RUF011.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,80 +1,90 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/ruff/mod.rs | ||
--- | ||
RUF011.py:15:2: RUF011 Dictionary comprehension uses static key: `"key"` | ||
RUF011.py:17:2: RUF011 Dictionary comprehension uses static key: `"key"` | ||
| | ||
14 | # Errors | ||
15 | {"key": value.upper() for value in data} | ||
16 | # Errors | ||
17 | {"key": value.upper() for value in data} | ||
| ^^^^^ RUF011 | ||
16 | {True: value.upper() for value in data} | ||
17 | {0: value.upper() for value in data} | ||
18 | {True: value.upper() for value in data} | ||
19 | {0: value.upper() for value in data} | ||
| | ||
|
||
RUF011.py:16:2: RUF011 Dictionary comprehension uses static key: `True` | ||
RUF011.py:18:2: RUF011 Dictionary comprehension uses static key: `True` | ||
| | ||
14 | # Errors | ||
15 | {"key": value.upper() for value in data} | ||
16 | {True: value.upper() for value in data} | ||
16 | # Errors | ||
17 | {"key": value.upper() for value in data} | ||
18 | {True: value.upper() for value in data} | ||
| ^^^^ RUF011 | ||
17 | {0: value.upper() for value in data} | ||
18 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
19 | {0: value.upper() for value in data} | ||
20 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
| | ||
|
||
RUF011.py:17:2: RUF011 Dictionary comprehension uses static key: `0` | ||
RUF011.py:19:2: RUF011 Dictionary comprehension uses static key: `0` | ||
| | ||
15 | {"key": value.upper() for value in data} | ||
16 | {True: value.upper() for value in data} | ||
17 | {0: value.upper() for value in data} | ||
17 | {"key": value.upper() for value in data} | ||
18 | {True: value.upper() for value in data} | ||
19 | {0: value.upper() for value in data} | ||
| ^ RUF011 | ||
18 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
19 | {constant: value.upper() for value in data} | ||
20 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
21 | {constant: value.upper() for value in data} | ||
| | ||
|
||
RUF011.py:18:2: RUF011 Dictionary comprehension uses static key: `(1, "a")` | ||
RUF011.py:20:2: RUF011 Dictionary comprehension uses static key: `(1, "a")` | ||
| | ||
16 | {True: value.upper() for value in data} | ||
17 | {0: value.upper() for value in data} | ||
18 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
18 | {True: value.upper() for value in data} | ||
19 | {0: value.upper() for value in data} | ||
20 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
| ^^^^^^^^ RUF011 | ||
19 | {constant: value.upper() for value in data} | ||
20 | {constant + constant: value.upper() for value in data} | ||
21 | {constant: value.upper() for value in data} | ||
22 | {constant + constant: value.upper() for value in data} | ||
| | ||
|
||
RUF011.py:19:2: RUF011 Dictionary comprehension uses static key: `constant` | ||
RUF011.py:21:2: RUF011 Dictionary comprehension uses static key: `constant` | ||
| | ||
17 | {0: value.upper() for value in data} | ||
18 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
19 | {constant: value.upper() for value in data} | ||
19 | {0: value.upper() for value in data} | ||
20 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
21 | {constant: value.upper() for value in data} | ||
| ^^^^^^^^ RUF011 | ||
20 | {constant + constant: value.upper() for value in data} | ||
21 | {constant.attribute: value.upper() for value in data} | ||
22 | {constant + constant: value.upper() for value in data} | ||
23 | {constant.attribute: value.upper() for value in data} | ||
| | ||
|
||
RUF011.py:20:2: RUF011 Dictionary comprehension uses static key: `constant + constant` | ||
RUF011.py:22:2: RUF011 Dictionary comprehension uses static key: `constant + constant` | ||
| | ||
18 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
19 | {constant: value.upper() for value in data} | ||
20 | {constant + constant: value.upper() for value in data} | ||
20 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
21 | {constant: value.upper() for value in data} | ||
22 | {constant + constant: value.upper() for value in data} | ||
| ^^^^^^^^^^^^^^^^^^^ RUF011 | ||
21 | {constant.attribute: value.upper() for value in data} | ||
22 | {constant[0]: value.upper() for value in data} | ||
23 | {constant.attribute: value.upper() for value in data} | ||
24 | {constant[0]: value.upper() for value in data} | ||
| | ||
|
||
RUF011.py:21:2: RUF011 Dictionary comprehension uses static key: `constant.attribute` | ||
RUF011.py:23:2: RUF011 Dictionary comprehension uses static key: `constant.attribute` | ||
| | ||
19 | {constant: value.upper() for value in data} | ||
20 | {constant + constant: value.upper() for value in data} | ||
21 | {constant.attribute: value.upper() for value in data} | ||
21 | {constant: value.upper() for value in data} | ||
22 | {constant + constant: value.upper() for value in data} | ||
23 | {constant.attribute: value.upper() for value in data} | ||
| ^^^^^^^^^^^^^^^^^^ RUF011 | ||
22 | {constant[0]: value.upper() for value in data} | ||
24 | {constant[0]: value.upper() for value in data} | ||
25 | {tokens: token for token in tokens} | ||
| | ||
|
||
RUF011.py:22:2: RUF011 Dictionary comprehension uses static key: `constant[0]` | ||
RUF011.py:24:2: RUF011 Dictionary comprehension uses static key: `constant[0]` | ||
| | ||
20 | {constant + constant: value.upper() for value in data} | ||
21 | {constant.attribute: value.upper() for value in data} | ||
22 | {constant[0]: value.upper() for value in data} | ||
22 | {constant + constant: value.upper() for value in data} | ||
23 | {constant.attribute: value.upper() for value in data} | ||
24 | {constant[0]: value.upper() for value in data} | ||
| ^^^^^^^^^^^ RUF011 | ||
25 | {tokens: token for token in tokens} | ||
| | ||
|
||
RUF011.py:25:2: RUF011 Dictionary comprehension uses static key: `tokens` | ||
| | ||
23 | {constant.attribute: value.upper() for value in data} | ||
24 | {constant[0]: value.upper() for value in data} | ||
25 | {tokens: token for token in tokens} | ||
| ^^^^^^ RUF011 | ||
| | ||
|
||
|
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