Issue#1364: Added rules subprogram_kind_500 and subprogram_kind_501.

This commit is contained in:
JHertz5 2024-12-21 17:45:28 +00:00
parent 696656a095
commit 1ad29342c3
4 changed files with 75 additions and 0 deletions

View File

@ -180,6 +180,7 @@ from vsg.rules import signal
from vsg.rules import shift_operator
from vsg.rules import source_file
from vsg.rules import subprogram_body
from vsg.rules import subprogram_kind
from vsg.rules import subtype
from vsg.rules import type_definition
from vsg.rules import use_clause

View File

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
from .rule_500 import rule_500
from .rule_501 import rule_501

View File

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
from vsg import token
from vsg.rules import token_case
lTokens = []
lTokens.append(token.subprogram_kind.procedure_keyword)
class rule_500(token_case):
"""
This rule checks that the **procedure** keyword in subprogram kinds has the proper case.
|configuring_uppercase_and_lowercase_rules_link|
**Violation**
.. code-block:: vhdl
end PROCEDURE parity;
PROCEDURE my_proc is new my_generic_proc
**Fix**
.. code-block:: vhdl
end PROCEDURE parity;
PROCEDURE my_proc is new my_generic_proc
"""
def __init__(self):
super().__init__(lTokens)
self.groups.append("case::keyword")

View File

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
from vsg import token
from vsg.rules import token_case
lTokens = []
lTokens.append(token.subprogram_kind.function_keyword)
class rule_501(token_case):
"""
This rule checks that the **function** keyword in subprogram kinds has the proper case.
|configuring_uppercase_and_lowercase_rules_link|
**Violation**
.. code-block:: vhdl
end FUNCTION parity;
FUNCTION my_func is new my_generic_func
**Fix**
.. code-block:: vhdl
end FUNCTION parity;
FUNCTION my_func is new my_generic_func
"""
def __init__(self):
super().__init__(lTokens)
self.groups.append("case::keyword")