Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#416)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.9.1 → 23.10.1](psf/black@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 <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and cooperlees authored Oct 25, 2023
1 parent f8fe3c4 commit 78d08a7
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion tests/b002.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
B002 - on lines 15 and 20
"""


def this_is_all_fine(n):
x = n + 1
y = 1 + n
Expand Down
1 change: 1 addition & 0 deletions tests/b017.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Should emit:
B017 - on lines 24, 26, 28, 31 and 32.
"""

import asyncio
import unittest

Expand Down
1 change: 0 additions & 1 deletion tests/b018_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
B018 - on lines 17-26, 30, 33
"""


class Foo1:
"""abc"""

Expand Down
1 change: 0 additions & 1 deletion tests/b018_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
B018 - on lines 16-25, 29, 32
"""


def foo1():
"""my docstring"""

Expand Down
1 change: 1 addition & 0 deletions tests/b019.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/b023.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
1 change: 0 additions & 1 deletion tests/b026.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
B026 - on lines 16, 17, 18, 19, 20, 21
"""


def foo(bar, baz, bam):
pass

Expand Down
1 change: 1 addition & 0 deletions tests/b031.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Should emit:
B031 - on lines 30, 34, 43
"""

import itertools
from itertools import groupby

Expand Down
1 change: 0 additions & 1 deletion tests/b901.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
B901 - on lines 9, 36
"""


def broken():
if True:
return [1, 2, 3]
Expand Down
92 changes: 46 additions & 46 deletions tests/test_bugbear.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -258,27 +258,27 @@ 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):
filename = Path(__file__).absolute().parent / "b018_functions.py"
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):
filename = Path(__file__).absolute().parent / "b018_classes.py"
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):
Expand All @@ -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),
),
)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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),
),
)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 78d08a7

Please sign in to comment.