-
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
f08a5f6
commit 1e184e6
Showing
5 changed files
with
277 additions
and
32 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
52 changes: 49 additions & 3 deletions
52
...c/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.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,12 +1,58 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs | ||
--- | ||
PYI055.py:31:11: PYI055 Multiple `type` members in a union. Combine them into one, e.g., `type[requests_mock.Mocker | httpretty]`. | ||
PYI055.py:31:8: PYI055 [*] Multiple `type` members in a union. Combine them into one, e.g., `type[requests_mock.Mocker | httpretty | str]`. | ||
| | ||
29 | def func(): | ||
30 | # PYI055 | ||
31 | item: type[requests_mock.Mocker] | type[httpretty] = requests_mock.Mocker | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI055 | ||
31 | x: type[requests_mock.Mocker] | type[httpretty] | type[str] = requests_mock.Mocker | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI055 | ||
32 | y: Union[type[requests_mock.Mocker], type[httpretty], type[str]] = requests_mock.Mocker | ||
| | ||
= help: Combine multiple `type` members | ||
|
||
ℹ Fix | ||
28 28 | | ||
29 29 | def func(): | ||
30 30 | # PYI055 | ||
31 |- x: type[requests_mock.Mocker] | type[httpretty] | type[str] = requests_mock.Mocker | ||
31 |+ x: type[requests_mock.Mocker | httpretty | str] = requests_mock.Mocker | ||
32 32 | y: Union[type[requests_mock.Mocker], type[httpretty], type[str]] = requests_mock.Mocker | ||
33 33 | | ||
34 34 | | ||
|
||
PYI055.py:32:8: PYI055 [*] Multiple `type` members in a union. Combine them into one, e.g., `type[Union[requests_mock.Mocker, httpretty, str]]`. | ||
| | ||
30 | # PYI055 | ||
31 | x: type[requests_mock.Mocker] | type[httpretty] | type[str] = requests_mock.Mocker | ||
32 | y: Union[type[requests_mock.Mocker], type[httpretty], type[str]] = requests_mock.Mocker | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI055 | ||
| | ||
= help: Combine multiple `type` members | ||
|
||
ℹ Fix | ||
29 29 | def func(): | ||
30 30 | # PYI055 | ||
31 31 | x: type[requests_mock.Mocker] | type[httpretty] | type[str] = requests_mock.Mocker | ||
32 |- y: Union[type[requests_mock.Mocker], type[httpretty], type[str]] = requests_mock.Mocker | ||
32 |+ y: type[Union[requests_mock.Mocker, httpretty, str]] = requests_mock.Mocker | ||
33 33 | | ||
34 34 | | ||
35 35 | def func(): | ||
|
||
PYI055.py:39:8: PYI055 [*] Multiple `type` members in a union. Combine them into one, e.g., `type[Union[requests_mock.Mocker, httpretty, str]]`. | ||
| | ||
38 | # PYI055 | ||
39 | x: Union[type[requests_mock.Mocker], type[httpretty], type[str]] = requests_mock.Mocker | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PYI055 | ||
| | ||
= help: Combine multiple `type` members | ||
|
||
ℹ Fix | ||
36 36 | from typing import Union as U | ||
37 37 | | ||
38 38 | # PYI055 | ||
39 |- x: Union[type[requests_mock.Mocker], type[httpretty], type[str]] = requests_mock.Mocker | ||
39 |+ x: type[Union[requests_mock.Mocker, httpretty, str]] = requests_mock.Mocker | ||
|
||
|
Oops, something went wrong.