-
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.
…9428) ## Summary This rule was added to flake8-bugbear. In general, we tend to prefer redirecting to prominent plugins when our own rules are reimplemented (since more projects have `B` activated than `RUF`). ## Test Plan `cargo test`
- Loading branch information
1 parent
6adb5f8
commit 50fffcf
Showing
11 changed files
with
29 additions
and
28 deletions.
There are no files selected for viewing
File renamed without changes.
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
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
File renamed without changes.
38 changes: 19 additions & 19 deletions
38
...rules__ruff__tests__RUF011_RUF011.py.snap → ..._flake8_bugbear__tests__B035_B035.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,90 +1,90 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/ruff/mod.rs | ||
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs | ||
--- | ||
RUF011.py:17:2: RUF011 Dictionary comprehension uses static key: `"key"` | ||
B035.py:17:2: B035 Dictionary comprehension uses static key: `"key"` | ||
| | ||
16 | # Errors | ||
17 | {"key": value.upper() for value in data} | ||
| ^^^^^ RUF011 | ||
| ^^^^^ B035 | ||
18 | {True: value.upper() for value in data} | ||
19 | {0: value.upper() for value in data} | ||
| | ||
|
||
RUF011.py:18:2: RUF011 Dictionary comprehension uses static key: `True` | ||
B035.py:18:2: B035 Dictionary comprehension uses static key: `True` | ||
| | ||
16 | # Errors | ||
17 | {"key": value.upper() for value in data} | ||
18 | {True: value.upper() for value in data} | ||
| ^^^^ RUF011 | ||
| ^^^^ B035 | ||
19 | {0: value.upper() for value in data} | ||
20 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
| | ||
|
||
RUF011.py:19:2: RUF011 Dictionary comprehension uses static key: `0` | ||
B035.py:19:2: B035 Dictionary comprehension uses static key: `0` | ||
| | ||
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 | ||
| ^ B035 | ||
20 | {(1, "a"): value.upper() for value in data} # Constant tuple | ||
21 | {constant: value.upper() for value in data} | ||
| | ||
|
||
RUF011.py:20:2: RUF011 Dictionary comprehension uses static key: `(1, "a")` | ||
B035.py:20:2: B035 Dictionary comprehension uses static key: `(1, "a")` | ||
| | ||
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 | ||
| ^^^^^^^^ B035 | ||
21 | {constant: value.upper() for value in data} | ||
22 | {constant + constant: value.upper() for value in data} | ||
| | ||
|
||
RUF011.py:21:2: RUF011 Dictionary comprehension uses static key: `constant` | ||
B035.py:21:2: B035 Dictionary comprehension uses static key: `constant` | ||
| | ||
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 | ||
| ^^^^^^^^ B035 | ||
22 | {constant + constant: value.upper() for value in data} | ||
23 | {constant.attribute: value.upper() for value in data} | ||
| | ||
|
||
RUF011.py:22:2: RUF011 Dictionary comprehension uses static key: `constant + constant` | ||
B035.py:22:2: B035 Dictionary comprehension uses static key: `constant + constant` | ||
| | ||
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 | ||
| ^^^^^^^^^^^^^^^^^^^ B035 | ||
23 | {constant.attribute: value.upper() for value in data} | ||
24 | {constant[0]: value.upper() for value in data} | ||
| | ||
|
||
RUF011.py:23:2: RUF011 Dictionary comprehension uses static key: `constant.attribute` | ||
B035.py:23:2: B035 Dictionary comprehension uses static key: `constant.attribute` | ||
| | ||
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 | ||
| ^^^^^^^^^^^^^^^^^^ B035 | ||
24 | {constant[0]: value.upper() for value in data} | ||
25 | {tokens: token for token in tokens} | ||
| | ||
|
||
RUF011.py:24:2: RUF011 Dictionary comprehension uses static key: `constant[0]` | ||
B035.py:24:2: B035 Dictionary comprehension uses static key: `constant[0]` | ||
| | ||
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 | ||
| ^^^^^^^^^^^ B035 | ||
25 | {tokens: token for token in tokens} | ||
| | ||
|
||
RUF011.py:25:2: RUF011 Dictionary comprehension uses static key: `tokens` | ||
B035.py:25:2: B035 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 | ||
| ^^^^^^ B035 | ||
| | ||
|
||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.