Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from vsg.rules import keyword_alignment_rule
class rule_015(keyword_alignment_rule):
'''
Generic rule 015 ensures the alignment of the := operator for every
generic in the entity.
'''
def __init__(self):
keyword_alignment_rule.__init__(self, 'generic', '015')
self.solution = 'Inconsistent alignment of ":=" in generic declaration of entity.'
self.sKeyword = ':='
self.sStartGroupTrigger = 'isGenericKeyword'
self.sEndGroupTrigger = 'isEndGenericMap'
self.lLineTriggers = ['isGenericDeclaration']
from vsg.rules import keyword_alignment_rule
class rule_029(keyword_alignment_rule):
'''
Instantiation rule 029 ensures the alignment of inline comments in an instantiation.
'''
def __init__(self):
keyword_alignment_rule.__init__(self, 'instantiation', '029')
self.solution = 'Inconsistent alignment of comments in instantiation.'
self.sKeyword = '--'
self.sStartGroupTrigger = 'isInstantiationDeclaration'
self.sEndGroupTrigger = 'isInstantiationPortEnd'
self.lLineTriggers = ['hasInlineComment']
self.separate_generic_port_alignment = True
self.configuration.append('separate_generic_port_alignment')
self.configuration_triggers += [{'name': 'separate_generic_port_alignment', 'triggers': ['isInstantiationGenericEnd']}]
def __init__(self):
keyword_alignment_rule.__init__(self, 'entity', '017')
self.solution = 'Inconsistent alignment of ":" in generic or port declaration of entity.'
self.sKeyword = ':'
self.sStartGroupTrigger = 'isEntityDeclaration'
self.sEndGroupTrigger = 'isEndEntityDeclaration'
self.lLineTriggers = ['isGenericDeclaration', 'isPortDeclaration']
self.separate_generic_port_alignment = True
self.configuration.append('separate_generic_port_alignment')
self.configuration_triggers += [{'name': 'separate_generic_port_alignment', 'triggers': ['isEndGenericMap']}]
def __init__(self):
keyword_alignment_rule.__init__(self, 'concurrent', '006')
self.solution = 'Inconsistent alignment of "<=" in group of lines.'
self.sKeyword = '<='
self.sStartGroupTrigger = 'isArchitectureBegin'
self.sEndGroupTrigger = 'isEndArchitecture'
self.lLineTriggers = ['insideConcurrent']
def __init__(self):
keyword_alignment_rule.__init__(self, 'component', '020')
self.solution = 'Inconsistent alignment of comments in a component declaration.'
self.sKeyword = '--'
self.sStartGroupTrigger = 'isComponentDeclaration'
self.sEndGroupTrigger = 'isComponentEnd'
self.lLineTriggers = ['hasInlineComment']
self.phase = 6
self.separate_generic_port_alignment = True
self.configuration.append('separate_generic_port_alignment')
self.configuration_triggers += [{'name': 'separate_generic_port_alignment', 'triggers': ['isEndGenericMap']}]