Exemple #1
0
 def _ensure_super_context(self, node: ast.Call) -> None:
     parent_context = getattr(node, 'wps_context', None)
     if isinstance(parent_context, (ast.FunctionDef, ast.AsyncFunctionDef)):
         grand_context = getattr(parent_context, 'wps_context', None)
         if isinstance(grand_context, ast.ClassDef):
             return
     self.add_violation(
         IncorrectSuperCallViolation(node, text='not inside method'), )
 def _ensure_super_arguments(self, node: ast.Call) -> None:
     if len(node.args) > 0 or len(node.keywords) > 0:
         self.add_violation(
             IncorrectSuperCallViolation(node, text='remove arguments'),
         )