예제 #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))
예제 #2
0
 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))
예제 #3
0
 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))