vhdl-style-guide/vsg/rules/variable/rule_007.py

23 lines
638 B
Python

from vsg import rule
class rule_007(rule.rule):
'''
Signal rule 007 checks for default assignments in variable declarations.
'''
def __init__(self):
rule.rule.__init__(self)
self.name = 'variable'
self.identifier = '007'
self.solution = 'Remove default assignment.'
self.phase = 1
self.fixable = False # Allow the user to decide if these should be removed
def analyze(self, oFile):
for iLineNumber, oLine in enumerate(oFile.lines):
if oLine.isVariable:
if ':=' in oLine.line:
self.add_violation(iLineNumber)