From 1bc35586280ec5745848b81ef1a36c1fcfac2c3b Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 29 Nov 2020 12:48:02 -0800 Subject: [PATCH] B015: prepend "assert" and fix verb tense - See https://github.com/PyCQA/flake8-bugbear/issues/149 --- README.rst | 2 +- bugbear.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index bdaf7b1..e06792d 100644 --- a/README.rst +++ b/README.rst @@ -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. **B016**: Cannot raise a literal. Did you intend to return it or raise an Exception? diff --git a/bugbear.py b/bugbear.py index b137d03..7cb4d08 100644 --- a/bugbear.py +++ b/bugbear.py @@ -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(