How to use the vsg.check 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 / process / rule_020.py View on Github external
def analyze(self, oFile):
        for iLineNumber, oLine in enumerate(oFile.lines):
            if not self._is_vsg_off(oLine):
                if oLine.isSensitivityListBegin and oLine.isSensitivityListEnd:
                    continue
                if oLine.insideSensitivityList:
                    if oLine.isSensitivityListBegin:
                        iAlignmentColumn = oLine.line.find('(')
                    elif oLine.isSensitivityListEnd and re.match('^\s*\)', oLine.line):
                        continue
                    else:
                        check.multiline_alignment(self, iAlignmentColumn + 1, oLine, iLineNumber)
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / if_statement / rule_009.py View on Github external
if oLine.isIfKeyword and oLine.isThenKeyword:
                continue
            if oLine.isElseIfKeyword and oLine.isThenKeyword:
                continue
            if oLine.isIfKeyword:
                if re.match('^\s+if\s\(', oLine.lineLower):
                    iAlignmentColumn = oLine.lineLower.find('(')
                    fCheckAlignment = True
                continue  # pragma: no cover
            if oLine.isElseIfKeyword:
                if re.match('^\s+elsif\s\(', oLine.lineLower):
                    iAlignmentColumn = oLine.lineLower.find('(')
                    fCheckAlignment = True
                continue  # pragma: no cover
            if oLine.insideIf and fCheckAlignment:
                check.multiline_alignment(self, iAlignmentColumn + 1, oLine, iLineNumber)
            if oLine.isThenKeyword:
                fCheckAlignment = False
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / if_statement / rule_010.py View on Github external
def _analyze(self, oFile, oLine, iLineNumber):
        if oLine.isElseKeyword and not oLine.isIfKeyword:
            check.is_no_blank_line_before(self, oFile, iLineNumber, 'isEndCaseKeyword')
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / package / uppercase_package_name_rule.py View on Github external
def _analyze(self, oFile, oLine, iLineNumber):
        if oLine.__dict__[self.sTrigger] and check.has_package_name(oLine):
            check.is_uppercase(self, check.get_package_name(oLine), iLineNumber)
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / if_statement / rule_033.py View on Github external
def _analyze(self, oFile, oLine, iLineNumber):
        if oLine.isElseKeyword:
            check.indent_of_comments_above(self, oFile, iLineNumber)
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / case / rule_021.py View on Github external
def _analyze(self, oFile, oLine, iLineNumber):
        if oLine.isCaseWhenKeyword:
            check.indent_of_comments_above(self, oFile, iLineNumber)
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / if_statement / rule_032.py View on Github external
def _analyze(self, oFile, oLine, iLineNumber):
        if oLine.isElseIfKeyword:
            check.indent_of_comments_above(self, oFile, iLineNumber)
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / if_statement / rule_008.py View on Github external
def _analyze(self, oFile, oLine, iLineNumber):
        if oLine.isEndIfKeyword and not oLine.isIfKeyword:
            check.is_no_blank_line_before(self, oFile, iLineNumber, 'isEndCaseKeyword')
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / no_space_after_rule.py View on Github external
def _analyze(self, oFile, oLine, iLineNumber):
        if oLine.__dict__[self.sTrigger]:
            check.is_no_space_after(self, self.sWord, oLine, iLineNumber)
github jeremiah-c-leary / vhdl-style-guide / vsg / rules / generic / rule_012.py View on Github external
def _analyze(self, oFile, oLine, iLineNumber):
        if oLine.isGenericKeyword and not self.fGroupFound and not oLine.isGenericDeclaration:
            self.fGroupFound = True
            self.iStartGroupIndex = iLineNumber
        if oLine.isEndGenericMap and self.fGroupFound:
            self.lGroup.append(oLine)
            self.fGroupFound = False
            check.keyword_alignment(self, self.iStartGroupIndex, ':', self.lGroup)
            self.lGroup = []
            self.iStartGroupIndex = None
        if self.fGroupFound:
            if oLine.isGenericDeclaration:
                self.lGroup.append(oLine)
            else:
                self.lGroup.append(line.line('Removed line'))