Exemplo n.º 1
0
 def _check_operator_count(self, node: _NumbersAndConstants) -> None:
     for node_type, limit in self._unary_limits.items():
         if count_unary_operator(node, node_type) > limit:
             text = str(node.n) if isinstance(node, ast.Num) else node.value
             self.add_violation(
                 consistency.UselessOperatorsViolation(node, text=text),
             )
Exemplo n.º 2
0
 def _check_operator_count(self, node: ast.Num) -> None:
     for node_type, limit in self._limits.items():
         if count_unary_operator(node, node_type) > limit:
             self.add_violation(
                 consistency.UselessOperatorsViolation(
                     node, text=str(node.n),
                 ),
             )