Skip to content

Commit

Permalink
Fix B026 on attributes (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra authored Nov 3, 2023
1 parent 78d08a7 commit 907e0dd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,12 @@ MIT
Change Log
----------

Unreleased
~~~~~~~~~~

* B026: Fix bug where the check was not triggered for calls where the callee
is an attribute

23.9.16
~~~~~~~

Expand Down
3 changes: 1 addition & 2 deletions bugbear.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,7 @@ def visit_Call(self, node):
):
self.errors.append(B010(node.lineno, node.col_offset))

self.check_for_b026(node)

self.check_for_b026(node)
self.check_for_b028(node)
self.check_for_b034(node)
self.check_for_b905(node)
Expand Down
1 change: 1 addition & 0 deletions tests/b026.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ def foo(bar, baz, bam):
foo(bar="bar", baz="baz", bam="bam", *[])
foo(bam="bam", *["bar"], *["baz"])
foo(*["bar"], bam="bam", *["baz"])
foo.bar(bam="bam", *["bar"])
1 change: 1 addition & 0 deletions tests/test_bugbear.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ def test_b026(self):
B026(19, 15),
B026(19, 25),
B026(20, 25),
B026(21, 19),
),
)

Expand Down

0 comments on commit 907e0dd

Please sign in to comment.