1610 self.violations.append((node, "M654")) |
1610 self.violations.append((node, "M654")) |
1611 |
1611 |
1612 super().generic_visit(node) |
1612 super().generic_visit(node) |
1613 |
1613 |
1614 |
1614 |
|
1615 ####################################################################### |
|
1616 ## BugBearVisitor |
|
1617 ## |
|
1618 ## adapted from: flake8-bugbear v22.12.6 |
|
1619 ## |
|
1620 ## Original: Copyright (c) 2016 Łukasz Langa |
|
1621 ####################################################################### |
|
1622 |
1615 BugBearContext = namedtuple("BugBearContext", ["node", "stack"]) |
1623 BugBearContext = namedtuple("BugBearContext", ["node", "stack"]) |
1616 |
1624 |
1617 |
1625 |
1618 class BugBearVisitor(ast.NodeVisitor): |
1626 class BugBearVisitor(ast.NodeVisitor): |
1619 """ |
1627 """ |
1620 Class implementing a node visitor to check for various topics. |
1628 Class implementing a node visitor to check for various topics. |
1621 """ |
1629 """ |
1622 |
|
1623 # |
|
1624 # This class was implemented along flake8-bugbear (v 22.12.6). |
|
1625 # Original: Copyright (c) 2016 Łukasz Langa |
|
1626 # |
|
1627 |
1630 |
1628 CONTEXTFUL_NODES = ( |
1631 CONTEXTFUL_NODES = ( |
1629 ast.Module, |
1632 ast.Module, |
1630 ast.ClassDef, |
1633 ast.ClassDef, |
1631 ast.AsyncFunctionDef, |
1634 ast.AsyncFunctionDef, |