From fdafb60e2cea7c8b4de169595e3514eab82b8d1d Mon Sep 17 00:00:00 2001 From: JHertz5 Date: Sat, 21 Dec 2024 11:21:34 +0000 Subject: [PATCH] Issue#1361: Added rule array_constraint_500. --- vsg/rules/__init__.py | 1 + vsg/rules/array_constraint/__init__.py | 3 +++ vsg/rules/array_constraint/rule_500.py | 32 ++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 vsg/rules/array_constraint/__init__.py create mode 100644 vsg/rules/array_constraint/rule_500.py diff --git a/vsg/rules/__init__.py b/vsg/rules/__init__.py index c4fe7c32..a7040467 100644 --- a/vsg/rules/__init__.py +++ b/vsg/rules/__init__.py @@ -111,6 +111,7 @@ from vsg.rules import alias_declaration from vsg.rules import after from vsg.rules import aggregate from vsg.rules import architecture +from vsg.rules import array_constraint from vsg.rules import assert_statement from vsg.rules import attribute from vsg.rules import attribute_declaration diff --git a/vsg/rules/array_constraint/__init__.py b/vsg/rules/array_constraint/__init__.py new file mode 100644 index 00000000..c5c1c6e6 --- /dev/null +++ b/vsg/rules/array_constraint/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from .rule_500 import rule_500 diff --git a/vsg/rules/array_constraint/rule_500.py b/vsg/rules/array_constraint/rule_500.py new file mode 100644 index 00000000..8d7706ce --- /dev/null +++ b/vsg/rules/array_constraint/rule_500.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +from vsg import token +from vsg.rules import token_case + +lTokens = [] +lTokens.append(token.array_constraint.open_keyword) + + +class rule_500(token_case): + """ + This rule checks the **open** keyword in array constraints has the proper case. + + |configuring_uppercase_and_lowercase_rules_link| + + **Violation** + + .. code-block:: vhdl + + subtype t_my_array is t_array(OPEN)(t_range); + + + **Fix** + + .. code-block:: vhdl + + subtype t_my_array is t_array(open)(t_range); + """ + + def __init__(self): + super().__init__(lTokens) + self.groups.append("case::keyword")