Пример #1
0
 def _check_empty_line_wrap(
     self,
     token: tokenize.TokenInfo,
     *,
     delta: int,
 ) -> None:
     tokens = self._lines.get(token.start[0] + delta)
     if tokens is not None and only_contains(tokens, NEWLINES):
         self.add_violation(BracketBlankLineViolation(token))
 def _check_closing(
     self,
     token: tokenize.TokenInfo,
     index: int,
     tokens: List[tokenize.TokenInfo],
 ) -> None:
     tokens_before = tokens[:index]
     annotated = self._annotate_brackets(tokens_before)
     if annotated[_get_reverse_bracket(token)] == 0:
         if not only_contains(tokens_before, ALLOWED_EMPTY_LINE_TOKENS):
             self.add_violation(WrongBracketPositionViolation(token))