def _fix_violation(self, oViolation):
     lTokens = oViolation.get_tokens()
     dAction = oViolation.get_action()
     oMoveToken = lTokens.pop(dAction['moveIndex'])
     rules_utils.insert_token(lTokens, dAction['insertIndex'], oMoveToken)
     rules_utils.insert_whitespace(lTokens, dAction['insertIndex'])
     lTokens = utils.fix_blank_lines(lTokens)
     oViolation.set_tokens(lTokens)
Ejemplo n.º 2
0
    def _fix_violation(self, oViolation):
        lTokens = oViolation.get_tokens()
        iIndex = oViolation.get_token_value()

        lTokens.insert(1, lTokens.pop(iIndex))
        lTokens.insert(1, parser.whitespace(' '))
        lNewTokens = utils.remove_consecutive_whitespace_tokens(lTokens)
        lNewTokens = utils.fix_blank_lines(lNewTokens)

        oViolation.set_tokens(lNewTokens)
    def _fix_violation(self, oViolation):
        lTokens = oViolation.get_tokens()
        iIndex = oViolation.get_token_value()

        rules_utils.insert_token(lTokens, 1, lTokens.pop(iIndex))
        rules_utils.insert_whitespace(lTokens, 1)
        lNewTokens = utils.remove_consecutive_whitespace_tokens(lTokens)
        lNewTokens = utils.fix_blank_lines(lNewTokens)

        oViolation.set_tokens(lNewTokens)
    def _fix_violation(self, oViolation):
        lTokens = oViolation.get_tokens()
        dAction = oViolation.get_action()

        oToken = lTokens.pop(dAction['move_index'])
        rules_utils.insert_token(lTokens, dAction['insert'], oToken)
        if self.bInsertWhitespace:
            rules_utils.insert_whitespace(lTokens, dAction['insert'])
        lTokens = utils.remove_consecutive_whitespace_tokens(lTokens)
        lTokens = utils.fix_blank_lines(lTokens)
        oViolation.set_tokens(lTokens)
Ejemplo n.º 5
0
 def fix_blank_lines(self):
     self.lAllObjects = utils.fix_blank_lines(self.lAllObjects)