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

Extend PIE790 to ellipses #8602

Closed
doolio opened this issue Nov 10, 2023 · 3 comments · Fixed by #8641
Closed

Extend PIE790 to ellipses #8602

doolio opened this issue Nov 10, 2023 · 3 comments · Fixed by #8641
Assignees
Labels
rule Implementing or modifying a lint rule

Comments

@doolio
Copy link
Contributor

doolio commented Nov 10, 2023

No description provided.

@charliermarsh
Copy link
Member

That would be reasonable. The other option is to implement a standalone rule for this, as in Pylint: #4726. The blocker we ran into there is that we have an existing rule from flake8-pyi (PYI013) that enforces this logic just for classes, so we likely need to deprecate that rule.

I don't see a reason not to have ellipsis and pass in the same rule, though. So we could extend PIE790 (under --preview for now), and then mark PYI013 as deprecated.

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Nov 11, 2023
@charliermarsh charliermarsh changed the title Should PIE790 be extended to ellipses considering they can be used in the same way as pass Extend PIE790 to ellipses Nov 11, 2023
@Skylion007
Copy link
Contributor

We would have to make sure PIE790 applies to .pyi files too though as we deprecate PYI013.

@charliermarsh
Copy link
Member

@Skylion007 -- Confirmed, it does.

@charliermarsh charliermarsh self-assigned this Nov 13, 2023
charliermarsh added a commit that referenced this issue Nov 13, 2023
…8641)

## Summary

This PR extends `unnecessary-pass` (`PIE790`) to flag unnecessary
ellipsis expressions in addition to `pass` statements. A `pass` is
equivalent to a standalone `...`, so it feels correct to me that a
single rule should cover both cases.

When we look to v0.2.0, we should also consider deprecating `PYI013`,
which flags ellipses only for classes.

Closes #8602.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants