From 78d08a741fc5053d2571a85f27e18f4625c1c269 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 10:49:07 -0700 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#416) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 23.9.1 → 23.10.1](https://github.com/psf/black/compare/23.9.1...23.10.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Painfully fix all the line numbers do to reformat from black ... --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Cooper Ry Lees --- .pre-commit-config.yaml | 2 +- tests/b002.py | 1 - tests/b017.py | 1 + tests/b018_classes.py | 1 - tests/b018_functions.py | 1 - tests/b019.py | 1 + tests/b023.py | 1 + tests/b026.py | 1 - tests/b031.py | 1 + tests/b901.py | 1 - tests/test_bugbear.py | 92 ++++++++++++++++++++--------------------- 11 files changed, 51 insertions(+), 52 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d6d121..5a95933 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: isort - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.10.1 hooks: - id: black args: diff --git a/tests/b002.py b/tests/b002.py index 41b53c4..718946f 100644 --- a/tests/b002.py +++ b/tests/b002.py @@ -3,7 +3,6 @@ B002 - on lines 15 and 20 """ - def this_is_all_fine(n): x = n + 1 y = 1 + n diff --git a/tests/b017.py b/tests/b017.py index 9d508a9..2365cd1 100644 --- a/tests/b017.py +++ b/tests/b017.py @@ -2,6 +2,7 @@ Should emit: B017 - on lines 24, 26, 28, 31 and 32. """ + import asyncio import unittest diff --git a/tests/b018_classes.py b/tests/b018_classes.py index 7992f15..4dc9ca2 100644 --- a/tests/b018_classes.py +++ b/tests/b018_classes.py @@ -3,7 +3,6 @@ B018 - on lines 17-26, 30, 33 """ - class Foo1: """abc""" diff --git a/tests/b018_functions.py b/tests/b018_functions.py index 763d6b8..a4c2b49 100644 --- a/tests/b018_functions.py +++ b/tests/b018_functions.py @@ -3,7 +3,6 @@ B018 - on lines 16-25, 29, 32 """ - def foo1(): """my docstring""" diff --git a/tests/b019.py b/tests/b019.py index 3a1d01e..93042fc 100644 --- a/tests/b019.py +++ b/tests/b019.py @@ -2,6 +2,7 @@ Should emit: B019 - on lines 73, 77, 81, 85, 89, 93, 97, 101 """ + import functools from functools import cache, cached_property, lru_cache diff --git a/tests/b023.py b/tests/b023.py index 35a1e5b..bcbea9a 100644 --- a/tests/b023.py +++ b/tests/b023.py @@ -2,6 +2,7 @@ Should emit: B023 - on lines 12, 13, 16, 28, 29, 30, 31, 40, 42, 50, 51, 52, 53, 61, 68. """ + from functools import reduce functions = [] diff --git a/tests/b026.py b/tests/b026.py index ada19b4..fb8b1dd 100644 --- a/tests/b026.py +++ b/tests/b026.py @@ -3,7 +3,6 @@ B026 - on lines 16, 17, 18, 19, 20, 21 """ - def foo(bar, baz, bam): pass diff --git a/tests/b031.py b/tests/b031.py index a44a79b..3f3ef57 100644 --- a/tests/b031.py +++ b/tests/b031.py @@ -2,6 +2,7 @@ Should emit: B031 - on lines 30, 34, 43 """ + import itertools from itertools import groupby diff --git a/tests/b901.py b/tests/b901.py index 42fdda6..8caea73 100644 --- a/tests/b901.py +++ b/tests/b901.py @@ -3,7 +3,6 @@ B901 - on lines 9, 36 """ - def broken(): if True: return [1, 2, 3] diff --git a/tests/test_bugbear.py b/tests/test_bugbear.py index 77d953c..c71ff17 100644 --- a/tests/test_bugbear.py +++ b/tests/test_bugbear.py @@ -77,7 +77,7 @@ def test_b002(self): filename = Path(__file__).absolute().parent / "b002.py" bbc = BugBearChecker(filename=str(filename)) errors = list(bbc.run()) - self.assertEqual(errors, self.errors(B002(15, 8), B002(20, 11))) + self.assertEqual(errors, self.errors(B002(14, 8), B002(19, 11))) def test_b003(self): filename = Path(__file__).absolute().parent / "b003.py" @@ -258,7 +258,7 @@ def test_b017(self): filename = Path(__file__).absolute().parent / "b017.py" bbc = BugBearChecker(filename=str(filename)) errors = list(bbc.run()) - expected = self.errors(B017(24, 8), B017(26, 8), B017(28, 8)) + expected = self.errors(B017(25, 8), B017(27, 8), B017(29, 8)) self.assertEqual(errors, expected) def test_b018_functions(self): @@ -266,9 +266,9 @@ def test_b018_functions(self): bbc = BugBearChecker(filename=str(filename)) errors = list(bbc.run()) - expected = [B018(line, 4) for line in range(16, 26)] - expected.append(B018(29, 4)) - expected.append(B018(32, 4)) + expected = [B018(line, 4) for line in range(15, 25)] + expected.append(B018(28, 4)) + expected.append(B018(31, 4)) self.assertEqual(errors, self.errors(*expected)) def test_b018_classes(self): @@ -276,9 +276,9 @@ def test_b018_classes(self): bbc = BugBearChecker(filename=str(filename)) errors = list(bbc.run()) - expected = [B018(line, 4) for line in range(17, 27)] - expected.append(B018(30, 4)) - expected.append(B018(33, 4)) + expected = [B018(line, 4) for line in range(16, 26)] + expected.append(B018(29, 4)) + expected.append(B018(32, 4)) self.assertEqual(errors, self.errors(*expected)) def test_b018_modules(self): @@ -296,14 +296,14 @@ def test_b019(self): self.assertEqual( errors, self.errors( - B019(60, 5), - B019(63, 5), - B019(66, 5), - B019(69, 5), - B019(72, 5), - B019(75, 5), - B019(78, 5), - B019(81, 5), + B019(61, 5), + B019(64, 5), + B019(67, 5), + B019(70, 5), + B019(73, 5), + B019(76, 5), + B019(79, 5), + B019(82, 5), ), ) @@ -348,29 +348,29 @@ def test_b023(self): bbc = BugBearChecker(filename=str(filename)) errors = list(bbc.run()) expected = self.errors( - B023(12, 29, vars=("x",)), - B023(13, 29, vars=("y",)), - B023(16, 15, vars=("x",)), - B023(28, 18, vars=("x",)), + B023(13, 29, vars=("x",)), + B023(14, 29, vars=("y",)), + B023(17, 15, vars=("x",)), B023(29, 18, vars=("x",)), B023(30, 18, vars=("x",)), - B023(31, 21, vars=("x",)), - B023(40, 33, vars=("x",)), - B023(42, 13, vars=("x",)), - B023(50, 29, vars=("a",)), - B023(51, 29, vars=("a_",)), - B023(52, 29, vars=("b",)), - B023(53, 29, vars=("c",)), - B023(61, 16, vars=("j",)), - B023(61, 20, vars=("k",)), - B023(68, 9, vars=("l",)), - B023(113, 23, vars=("x",)), - B023(114, 26, vars=("x",)), - B023(115, 36, vars=("x",)), - B023(116, 37, vars=("x",)), - B023(117, 36, vars=("x",)), - B023(168, 28, vars=("name",)), # known false alarm - B023(171, 28, vars=("i",)), + B023(31, 18, vars=("x",)), + B023(32, 21, vars=("x",)), + B023(41, 33, vars=("x",)), + B023(43, 13, vars=("x",)), + B023(51, 29, vars=("a",)), + B023(52, 29, vars=("a_",)), + B023(53, 29, vars=("b",)), + B023(54, 29, vars=("c",)), + B023(62, 16, vars=("j",)), + B023(62, 20, vars=("k",)), + B023(69, 9, vars=("l",)), + B023(114, 23, vars=("x",)), + B023(115, 26, vars=("x",)), + B023(116, 36, vars=("x",)), + B023(117, 37, vars=("x",)), + B023(118, 36, vars=("x",)), + B023(169, 28, vars=("name",)), # known false alarm + B023(172, 28, vars=("i",)), ) self.assertEqual(errors, expected) @@ -408,13 +408,13 @@ def test_b026(self): self.assertEqual( errors, self.errors( + B026(15, 15), B026(16, 15), - B026(17, 15), - B026(18, 26), - B026(19, 37), - B026(20, 15), + B026(17, 26), + B026(18, 37), + B026(19, 15), + B026(19, 25), B026(20, 25), - B026(21, 25), ), ) @@ -464,9 +464,9 @@ def test_b031(self): bbc = BugBearChecker(filename=str(filename)) errors = list(bbc.run()) expected = self.errors( - B031(30, 36, vars=("section_items",)), - B031(34, 30, vars=("section_items",)), - B031(43, 36, vars=("section_items",)), + B031(31, 36, vars=("section_items",)), + B031(35, 30, vars=("section_items",)), + B031(44, 36, vars=("section_items",)), ) self.assertEqual(errors, expected) @@ -645,7 +645,7 @@ def test_b901(self): filename = Path(__file__).absolute().parent / "b901.py" bbc = BugBearChecker(filename=str(filename)) errors = list(bbc.run()) - self.assertEqual(errors, self.errors(B901(9, 8), B901(36, 4))) + self.assertEqual(errors, self.errors(B901(8, 8), B901(35, 4))) def test_b902(self): filename = Path(__file__).absolute().parent / "b902.py"