Esempio n. 1
0
 def _check_wrong_function_called(self, node: ast.Call) -> None:
     function_name = functions.given_function_called(
         node,
         constants.FUNCTIONS_BLACKLIST,
     )
     if function_name:
         self.add_violation(
             WrongFunctionCallViolation(node, text=function_name), )
Esempio n. 2
0
    def visit_Call(self, node: ast.Call) -> None:
        """
        Used to find ``FUNCTIONS_BLACKLIST`` calls.

        Raises:
            WrongFunctionCallViolation

        """
        function_name = given_function_called(node, FUNCTIONS_BLACKLIST)
        if function_name:
            self.add_violation(WrongFunctionCallViolation(
                node, text=function_name,
            ))

        self.generic_visit(node)
 def _check_super_call(self, node: ast.Call) -> None:
     function_name = functions.given_function_called(node, ['super'])
     if function_name:
         self._ensure_super_context(node)
         self._ensure_super_arguments(node)