Example #1
0
 def _check_decorators(self, node: ast.FunctionDef) -> None:
     for decorator in node.decorator_list:
         decorator_name = getattr(decorator, 'id', None)
         if decorator_name == 'staticmethod':
             self.add_violation(StaticMethodViolation(node))
 def _check_decorators(self, node: types.AnyFunctionDef) -> None:
     for decorator in node.decorator_list:
         decorator_name = getattr(decorator, 'id', None)
         if decorator_name in self._staticmethod_names:
             self.add_violation(StaticMethodViolation(node))
 def _check_decorators(self, node: AnyFunctionDef) -> None:
     for decorator in node.decorator_list:
         decorator_name = getattr(decorator, 'id', None)
         if decorator_name == 'staticmethod':  # TODO: refactor magic str
             self.add_violation(StaticMethodViolation(node))