-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Y062: Forbid duplicates in
Literal[]
slices (#449)
Previous discussion for context: #435 (comment) Example: `Literal[True, True, False, False]` - emits Y062 for both `True` and `False`. This is how the new rule interacts with Y061: - `Literal[None]`, `Literal[None, None]`, etc.. - Only Y061 is emitted and the suggestion is always just `None` (previously `Literal[None, None]` would suggest `Literal[] | None`) - Combination of `None` and other duplicates e.g. `Literal[None, True, True]` - only Y062 is emitted --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
- Loading branch information
1 parent
7933e84
commit 70aa7a3
Showing
4 changed files
with
88 additions
and
19 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
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