Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive in PYI files with ellipsis for PIE796 #8818

Closed
Skylion007 opened this issue Nov 22, 2023 · 2 comments · Fixed by #8825
Closed

False positive in PYI files with ellipsis for PIE796 #8818

Skylion007 opened this issue Nov 22, 2023 · 2 comments · Fixed by #8825
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Skylion007
Copy link

If I define an enum file with ellipsis in PYI files, the linter complains

class CreationMeta(Enum):
    DEFAULT = ...
    IN_CUSTOM_FUNCTION = ...
    MULTI_OUTPUT_NODE = ...
    NO_GRAD_MODE = ...
    INFERENCE_MODE = ...

in a .PYI files, these values are all set to ... to denote that they will be populated in other code, and we only care about what the members of the enum are. This is a pretty common idiom so we may want to explicitly whitelist in our check or at least propose a better fix for PYI files as I am unaware of another way of doing this with a placeholder value for Enum.

@zanieb zanieb added the bug Something isn't working label Nov 22, 2023
@charliermarsh
Copy link
Member

Agree, this makes sense to fix IMO.

@zanieb zanieb added the good first issue Good for newcomers label Nov 22, 2023
@Avasam
Copy link

Avasam commented Nov 22, 2023

In a strict statically type-checked context, I feel this might still be undesirable? But that's more for a rule like PyCQA/flake8-pyi#98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants