def _check_bound_methods(self, node: types.AnyFunctionDef) -> None:
        node_context = get_context(node)
        if not isinstance(node_context, ast.ClassDef):
            return

        if not get_all_arguments(node):
            self.add_violation(
                MethodWithoutArgumentsViolation(node, text=node.name), )

        if node.name in constants.MAGIC_METHODS_BLACKLIST:
            self.add_violation(BadMagicMethodViolation(node, text=node.name))
 def _check_magic_methods(self, node: types.AnyFunctionDef) -> None:
     if node.name in constants.MAGIC_METHODS_BLACKLIST:
         self.add_violation(BadMagicMethodViolation(node, text=node.name))
Example #3
0
 def _check_magic_methods(self, node: ast.FunctionDef) -> None:
     if node.name in BAD_MAGIC_METHODS:
         self.add_violation(BadMagicMethodViolation(node, text=node.name))