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

N818 ErrorSuffixOnExceptionName should apply recursively to sub-subclasses of Exception #783

Closed
andersk opened this issue Nov 17, 2022 · 1 comment · Fixed by #796
Closed
Labels
bug Something isn't working

Comments

@andersk
Copy link
Contributor

andersk commented Nov 17, 2022

This triggers N818 exception name 'Bar' should be named with an Error suffix in pep8-naming but not in Ruff:

class FooError(Exception):
    pass

class Bar(FooError):
    pass

pep8-naming checks this by recursively searching all ancestor classes, although it may be nearly as effective to just check whether an immediate parent class has a name ending in Error.

@charliermarsh charliermarsh added the bug Something isn't working label Nov 17, 2022
@charliermarsh
Copy link
Member

Yeah let's do the latter for now (checking parent names) as a heuristic.

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

Successfully merging a pull request may close this issue.

2 participants