Refactoring fix violations to not require _fix_violations in the rule if the rule is not fixable.
This commit is contained in:
parent
6aee8bad9b
commit
fe0fb074e9
19
vsg/rule.py
19
vsg/rule.py
|
|
@ -44,23 +44,16 @@ class rule():
|
|||
return 0
|
||||
|
||||
def fix(self, oFile):
|
||||
self.analyze(oFile)
|
||||
self._fix_violations(oFile)
|
||||
self.violations = []
|
||||
self.dFix = {}
|
||||
self.dFix['violations'] = {}
|
||||
|
||||
def _fix_violations(self, oFile):
|
||||
return
|
||||
if self.fixable:
|
||||
self.analyze(oFile)
|
||||
self._fix_violations(oFile)
|
||||
self.violations = []
|
||||
self.dFix = {}
|
||||
self.dFix['violations'] = {}
|
||||
|
||||
def add_violation(self, lineNumber):
|
||||
self.violations.append(lineNumber)
|
||||
|
||||
# def _clear_violations(self):
|
||||
# self.violations = []
|
||||
# self.dFix = {}
|
||||
# self.dFix['violations'] = {}
|
||||
|
||||
def _configure_global_rule_attributes(self, dConfiguration):
|
||||
try:
|
||||
for sAttributeName in dConfiguration['rule']['global']:
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class rule_005(architecture_rule):
|
|||
self.identifier = '005'
|
||||
self.solution = 'Ensure "of" keyword is on the same line as the "architecture" keyword.'
|
||||
self.phase = 1
|
||||
self.fixable = False # There is an example of this for entity
|
||||
|
||||
def analyze(self, oFile):
|
||||
for iLineNumber, oLine in enumerate(oFile.lines):
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class rule_006(architecture_rule):
|
|||
self.identifier = '006'
|
||||
self.solution = 'Ensure "is" keyword is on the same line as the "architecture" keyword.'
|
||||
self.phase = 1
|
||||
self.fixable = False # There is an example of this for entity
|
||||
|
||||
def analyze(self, oFile):
|
||||
for iLineNumber, oLine in enumerate(oFile.lines):
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@ class rule_016(generic_rule):
|
|||
def __init__(self):
|
||||
generic_rule.__init__(self)
|
||||
self.identifier = '016'
|
||||
self.solution = 'Move multiple generates to their own lines.'
|
||||
self.solution = 'Move multiple generics to their own lines.'
|
||||
self.phase = 1
|
||||
self.fixable = False # Need to figure out how to fix this
|
||||
|
||||
def analyze(self, oFile):
|
||||
for iLineNumber, oLine in enumerate(oFile.lines):
|
||||
|
|
|
|||
Loading…
Reference in New Issue