Skip to content

Commit 83e6807

Browse files
[pre-commit.ci] pre-commit autoupdate (#322)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pycqa/isort: 5.10.1 → 5.11.1](PyCQA/isort@5.10.1...5.11.1) - [github.com/psf/black: 22.10.0 → 22.12.0](psf/black@22.10.0...22.12.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix error line nunbers (due to new formatting) and swap generator with direct list comprehencion due to C400 lint Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Cooper Lees <[email protected]>
1 parent 815ab98 commit 83e6807

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ ci:
33

44
repos:
55
- repo: https://github.com/pycqa/isort
6-
rev: 5.10.1
6+
rev: 5.11.1
77
hooks:
88
- id: isort
99

1010
- repo: https://github.com/psf/black
11-
rev: 22.10.0
11+
rev: 22.12.0
1212
hooks:
1313
- id: black
1414
args:

bugbear.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ def should_warn(self, code):
168168
return True
169169

170170
LOG.info(
171-
"Optional warning %s not present in selected warnings: %r. Not "
172-
"firing it at all.",
171+
(
172+
"Optional warning %s not present in selected warnings: %r. Not "
173+
"firing it at all."
174+
),
173175
code,
174176
self.options.select,
175177
)

tests/b023.py

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def myfunc(x):
155155
sorted(functools.reduce(lambda y: x | y, range(3)))
156156
frozenset(functools.reduce(lambda y: x | y, range(3)))
157157

158+
158159
# OK because the lambda which references a loop variable is defined in a `return`
159160
# statement, and after we return the loop variable can't be redefined.
160161
# In principle we could do something fancy with `break`, but it's not worth it.

tests/b906.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# which has subfields, and contains no call to a method name containing `visit`
55
# anywhere in it's body
66

7+
78
# error
89
def visit_For():
910
...

tests/test_bugbear.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def test_b019(self):
307307
def test_b020(self):
308308
filename = Path(__file__).absolute().parent / "b020.py"
309309
bbc = BugBearChecker(filename=str(filename))
310-
errors = list(e for e in bbc.run() if e[2][:4] == "B020")
310+
errors = [e for e in bbc.run() if e[2][:4] == "B020"]
311311
self.assertEqual(
312312
errors,
313313
self.errors(
@@ -366,8 +366,8 @@ def test_b023(self):
366366
B023(115, 36, vars=("x",)),
367367
B023(116, 37, vars=("x",)),
368368
B023(117, 36, vars=("x",)),
369-
B023(167, 28, vars=("name",)), # known false alarm
370-
B023(170, 28, vars=("i",)),
369+
B023(168, 28, vars=("name",)), # known false alarm
370+
B023(171, 28, vars=("i",)),
371371
)
372372
self.assertEqual(errors, expected)
373373

@@ -515,7 +515,7 @@ def test_b906(self):
515515
bbc = BugBearChecker(filename=str(filename))
516516
errors = list(bbc.run())
517517
expected = [
518-
B906(8, 0),
518+
B906(9, 0),
519519
]
520520
self.assertEqual(errors, self.errors(*expected))
521521

0 commit comments

Comments
 (0)