How to use the vsg.utils.get_violating_line function in vsg

To help you get started, we’ve selected a few vsg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jeremiah-c-leary / vhdl-style-guide / vsg / rules / architecture / rule_024.py View on Github external
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))
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / port / rule_005.py View on Github external
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, ':')
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / generate / rule_014.py View on Github external
def _fix_violations(self, oFile):
        for dViolation in self.violations:
            fix.enforce_one_space_after_word(self, utils.get_violating_line(oFile, dViolation), ':')
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / search_for_and_replace_keyword_rule.py View on Github external
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), '\(')
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / multiple_spaces_after_rule.py View on Github external
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)
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / package / rule_007.py View on Github external
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:])
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / component / rule_019.py View on Github external
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
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / move_item_and_items_to_the_right_to_next_line_rule.py View on Github external
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)