You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However I think that a fix could be simpler than that: This rule probably shouldn't apply to stubs as it's out of the control of a stub's author (ref #14535 )
Rather than disabling the entire rule, I think the pattern should simply be ignored for stub files when checking for duplicates. It is possible that a stub author might add two members with the same value by mistake (say, via a copy and paste error).
Found this whilst applying various Ruff groups on typeshed out of curiosity.
According to the updated typing spec for typing enums (see Mypy: Change to Enum Membership Semantics and https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members, this is the recommended way to type an enum in stubs where the type is known but the value isn't:
This will trigger
PIE796
However I think that a fix could be simpler than that: This rule probably shouldn't apply to stubs as it's out of the control of a stub's author (ref #14535 )
ruff 0.8.4
command: ruff check --select=PIE --isolated
The text was updated successfully, but these errors were encountered: