diff --git a/vsg/rules/__init__.py b/vsg/rules/__init__.py index 464232e7..9e3868b3 100644 --- a/vsg/rules/__init__.py +++ b/vsg/rules/__init__.py @@ -160,6 +160,7 @@ from vsg.rules import source_file from vsg.rules import subprogram_body from vsg.rules import subtype from vsg.rules import type_definition +from vsg.rules import type_mark from vsg.rules import use_clause from vsg.rules import variable from vsg.rules import variable_assignment diff --git a/vsg/rules/type_mark/__init__.py b/vsg/rules/type_mark/__init__.py new file mode 100644 index 00000000..c5c1c6e6 --- /dev/null +++ b/vsg/rules/type_mark/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from .rule_500 import rule_500 diff --git a/vsg/rules/type_mark/rule_500.py b/vsg/rules/type_mark/rule_500.py new file mode 100644 index 00000000..7dd8eae0 --- /dev/null +++ b/vsg/rules/type_mark/rule_500.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +from vsg import token +from vsg.rules import token_case_with_prefix_suffix + +lTokens = [] +lTokens.append(token.type_mark.name) + + +class rule_500(token_case_with_prefix_suffix): + """ + This rule checks that the name has proper case. + + |configuring_uppercase_and_lowercase_rules_link| + + **Violation** + + .. code-block:: vhdl + + subtype my_subtype is MY_EXTERNAL_TYPE range 10 to 20; + + + **Fix** + + .. code-block:: vhdl + + subtype my_subtype is my_external_type range 10 to 20; + + """ + + def __init__(self): + super().__init__(lTokens) + self.configuration.append("prefix_exceptions") + self.configuration.append("suffix_exceptions") + self.groups.append("case::name")