Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#322)
Browse files Browse the repository at this point in the history
* [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 <cooper@meta.com>
  • Loading branch information
pre-commit-ci[bot] and cooperlees committed Dec 15, 2022
1 parent 815ab98 commit 83e6807
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ ci:

repos:
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.11.1
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
args:
Expand Down
6 changes: 4 additions & 2 deletions bugbear.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ def should_warn(self, code):
return True

LOG.info(
"Optional warning %s not present in selected warnings: %r. Not "
"firing it at all.",
(
"Optional warning %s not present in selected warnings: %r. Not "
"firing it at all."
),
code,
self.options.select,
)
Expand Down
1 change: 1 addition & 0 deletions tests/b023.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def myfunc(x):
sorted(functools.reduce(lambda y: x | y, range(3)))
frozenset(functools.reduce(lambda y: x | y, range(3)))


# OK because the lambda which references a loop variable is defined in a `return`
# statement, and after we return the loop variable can't be redefined.
# In principle we could do something fancy with `break`, but it's not worth it.
Expand Down
1 change: 1 addition & 0 deletions tests/b906.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# which has subfields, and contains no call to a method name containing `visit`
# anywhere in it's body


# error
def visit_For():
...
Expand Down
8 changes: 4 additions & 4 deletions tests/test_bugbear.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def test_b019(self):
def test_b020(self):
filename = Path(__file__).absolute().parent / "b020.py"
bbc = BugBearChecker(filename=str(filename))
errors = list(e for e in bbc.run() if e[2][:4] == "B020")
errors = [e for e in bbc.run() if e[2][:4] == "B020"]
self.assertEqual(
errors,
self.errors(
Expand Down Expand Up @@ -366,8 +366,8 @@ def test_b023(self):
B023(115, 36, vars=("x",)),
B023(116, 37, vars=("x",)),
B023(117, 36, vars=("x",)),
B023(167, 28, vars=("name",)), # known false alarm
B023(170, 28, vars=("i",)),
B023(168, 28, vars=("name",)), # known false alarm
B023(171, 28, vars=("i",)),
)
self.assertEqual(errors, expected)

Expand Down Expand Up @@ -515,7 +515,7 @@ def test_b906(self):
bbc = BugBearChecker(filename=str(filename))
errors = list(bbc.run())
expected = [
B906(8, 0),
B906(9, 0),
]
self.assertEqual(errors, self.errors(*expected))

Expand Down

0 comments on commit 83e6807

Please sign in to comment.