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

B015: prepend "assert" and fix verb tense #150

Merged
merged 1 commit into from Nov 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -118,7 +118,7 @@ instead of ``except (SomeError,):``.
Write ``except Exception:``, which catches exactly the same exceptions.

**B015**: Pointless comparison. This comparison does nothing but
wastes CPU instructions. Remove it.
waste CPU instructions. Either prepend ``assert`` or remove it.
Copy link
Collaborator

Choose a reason for hiding this comment

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

FWIW, assert could possibly not always technically be the right thing too ...


**B016**: Cannot raise a literal. Did you intend to return it or raise
an Exception?
Expand Down
4 changes: 2 additions & 2 deletions bugbear.py
Expand Up @@ -687,8 +687,8 @@ def visit(self, node):
}
B015 = Error(
message=(
"B015 Pointless comparison. This comparison does nothing but wastes "
"CPU instructions. Remove it."
"B015 Pointless comparison. This comparison does nothing but waste "
"CPU instructions. Either prepend `assert` or remove it."
)
)
B016 = Error(
Expand Down