Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _fix_violations(self, oFile):
for dViolation in self.violations:
oLine = utils.get_violating_line(oFile, dViolation)
sLine = oLine.line
sLabel = dViolation['label']
oLine.update_line(sLine.replace(';', ' ' + sLabel.upper() + ';', 1))
def _fix_violations(self, oFile):
for dViolation in self.violations:
oLine = utils.get_violating_line(oFile, dViolation)
fix.enforce_one_space_after_word(self, oLine, ':')
def _fix_violations(self, oFile):
for dViolation in self.violations:
fix.enforce_one_space_after_word(self, utils.get_violating_line(oFile, dViolation), ':')
def _fix_violations(self, oFile):
for dViolation in self.violations[::-1]:
oLine = utils.get_violating_line(oFile, dViolation)
oLine.update_line(re.sub('' + self.sKeyword2, '' + self.sKeyword2 + ' ' + self.sKeyword, oLine.line, 1, re.IGNORECASE))
utils.search_for_and_remove_keyword(oFile, utils.get_violation_linenumber(dViolation), '\(')
def _fix_violations(self, oFile):
for dViolation in self.violations:
oLine = utils.get_violating_line(oFile, dViolation)
fix.enforce_spaces_after_word(self, oLine, self.sWord, self.spaces)
def _fix_violations(self, oFile):
for dViolation in self.violations:
oLine = utils.get_violating_line(oFile, dViolation)
iIndex = oLine.lineLower.find('end') + len('end')
oLine.update_line(oLine.line[:iIndex] + ' package' + oLine.line[iIndex:])
def _fix_violations(self, oFile):
for dViolation in self.violations:
oLine = utils.get_violating_line(oFile, dViolation)
oLine.update_line(re.sub('\s*--.*', '', oLine.line))
oLine.hasInlineComment = False
def _fix_violations(self, oFile):
for dViolation in self.violations[::-1]:
oLine = utils.get_violating_line(oFile, dViolation)
oNewLine = copy.deepcopy(oLine)
lObjects = oLine.get_objects()
iLineNumber = utils.get_violation_line_number(dViolation)
lOldObjects = lObjects[:dViolation['iObject']]
lNewObjects = lObjects[dViolation['iObject']:]
oLine.update_objects(lOldObjects)
oNewLine.update_objects(lNewObjects)
oFile.insert_line(iLineNumber + 1, oNewLine)