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

Trigger N818 when parent ends in Error or Exception #796

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

charliermarsh
Copy link
Member

Resolves #783.

@charliermarsh charliermarsh merged commit 826ef7d into main Nov 17, 2022
@charliermarsh charliermarsh deleted the charlie/error branch November 17, 2022 19:51
@@ -224,7 +224,7 @@ pub fn error_suffix_on_exception_name(
) -> Option<Check> {
if bases.iter().any(|base| {
if let ExprKind::Name { id, .. } = &base.node {
id == "Exception"
id.ends_with("Exception") || id.ends_with("Error")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to exempt BaseException, maybe with id == "Exception" || id.ends_with("Error")?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

N818 ErrorSuffixOnExceptionName should apply recursively to sub-subclasses of Exception
2 participants