diff --git a/bugbear.py b/bugbear.py index 361fe0f..aabf9e5 100644 --- a/bugbear.py +++ b/bugbear.py @@ -34,9 +34,6 @@ def run(self): visitor = self.visitor(filename=self.filename, lines=self.lines) visitor.visit(self.tree) for e in itertools.chain(visitor.errors, self.gen_line_based_checks()): - if pycodestyle.noqa(self.lines[e.lineno - 1]): - continue - if self.should_warn(e.message[:4]): yield self.adapt_error(e) diff --git a/tests/b001.py b/tests/b001.py index 98f9ac2..455517f 100644 --- a/tests/b001.py +++ b/tests/b001.py @@ -41,13 +41,6 @@ def func(**kwargs): # should be except KeyError: return - results = something.call(debug=is_debug) - try: - results["ok"] - except: # noqa - # warning silenced - return - try: pass diff --git a/tests/b901.py b/tests/b901.py index ff497d7..42fdda6 100644 --- a/tests/b901.py +++ b/tests/b901.py @@ -45,11 +45,6 @@ async def not_broken4(): return 1 -def actually_not_broken(): - yield 2 - return 1 # noqa - - def not_broken5(): def inner(): return 2 diff --git a/tests/b950.py b/tests/b950.py index a12d109..1939105 100644 --- a/tests/b950.py +++ b/tests/b950.py @@ -4,5 +4,4 @@ " line is fine " " line is still fine " " line is no longer fine by any measures, yup" -" line is no longer fine by any measures but is silenced" # noqa "line is fine again" diff --git a/tests/test_bugbear.py b/tests/test_bugbear.py index ddf105a..be4fb0a 100644 --- a/tests/test_bugbear.py +++ b/tests/test_bugbear.py @@ -52,7 +52,7 @@ def test_b001(self): expected = self.errors( B001(8, 0, vars=("bare `except:`",)), B001(40, 4, vars=("bare `except:`",)), - B001(54, 0, vars=("`except ():`",)), + B001(47, 0, vars=("`except ():`",)), ) self.assertEqual(errors, expected)