diff --git a/docs/configuring_identifier_alignment_rules.rst b/docs/configuring_identifier_alignment_rules.rst index 5e433548..cb521044 100644 --- a/docs/configuring_identifier_alignment_rules.rst +++ b/docs/configuring_identifier_alignment_rules.rst @@ -148,3 +148,4 @@ Rules Enforcing Identifier Alignment * `package_019 `_ * `package_body_400 `_ * `procedure_010 `_ +* `protected_type_body_400 `_ diff --git a/docs/configuring_keyword_alignment_rules.rst b/docs/configuring_keyword_alignment_rules.rst index 4c17032b..d99940d8 100644 --- a/docs/configuring_keyword_alignment_rules.rst +++ b/docs/configuring_keyword_alignment_rules.rst @@ -986,6 +986,8 @@ Rules Enforcing Keyword Alignment * `process_035 `_ * `process_400 `_ * `process_401 `_ +* `protected_type_body_401 `_ +* `protected_type_body_402 `_ * `sequential_400 `_ * `subprogram_body_400 `_ * `subprogram_body_401 `_ diff --git a/docs/protected_type_body_rules.rst b/docs/protected_type_body_rules.rst index 9e07ed3d..bd98cee9 100644 --- a/docs/protected_type_body_rules.rst +++ b/docs/protected_type_body_rules.rst @@ -3,6 +3,87 @@ Protected Type Body Rules ------------------------- +protected_type_body_400 +####################### + +|phase_5| |error| |alignment| + +This rule checks the identifiers for all declarations are aligned in the protected type body declarative region. + +|configuring_identifier_alignment_rules_link| + +**Violation** + +.. code-block:: vhdl + + variable var1 : natural; + constant c_period : time; + +**Fix** + +.. code-block:: vhdl + + variable var1 : natural; + constant c_period : time; + +protected_type_body_401 +####################### + +|phase_5| |error| |alignment| + +This rule checks the colons are in the same column for all declarations in the protected type body declarative part. + +|configuring_keyword_alignment_rules_link| + +**Violation** + +.. code-block:: vhdl + + type my_type protected body is + + signal wr_en : std_logic; + signal rd_en : std_logic; + constant c_period : time; + + end protected body; + +**Fix** + +.. code-block:: vhdl + + type my_type protected body is + + signal wr_en : std_logic; + signal rd_en : std_logic; + constant c_period : time; + + end protected body; + +protected_type_body_402 +####################### + +|phase_5| |error| |alignment| + +This rule checks the colons are in the same column for all attribute specifications. + +|configuring_keyword_alignment_rules_link| + +**Violation** + +.. code-block:: vhdl + + attribute mark_debug of wr_en : signal is "true"; + attribute mark_debug of almost_empty : signal is "true"; + attribute mark_debug of full : signal is "true"; + +**Fix** + +.. code-block:: vhdl + + attribute mark_debug of wr_en : signal is "true"; + attribute mark_debug of almost_empty : signal is "true"; + attribute mark_debug of full : signal is "true"; + protected_type_body_500 ####################### diff --git a/docs/rule_groups/alignment_rule_group.rst b/docs/rule_groups/alignment_rule_group.rst index b493cddf..67723a43 100644 --- a/docs/rule_groups/alignment_rule_group.rst +++ b/docs/rule_groups/alignment_rule_group.rst @@ -64,6 +64,9 @@ Rules Enforcing Alignment Rule Group * `process_035 <../process_rules.html#process-035>`_ * `process_400 <../process_rules.html#process-400>`_ * `process_401 <../process_rules.html#process-401>`_ +* `protected_type_body_400 <../protected_type_body_rules.html#protected-type-body-400>`_ +* `protected_type_body_401 <../protected_type_body_rules.html#protected-type-body-401>`_ +* `protected_type_body_402 <../protected_type_body_rules.html#protected-type-body-402>`_ * `report_statement_400 <../report_statement_rules.html#report-statement-400>`_ * `selected_assignment_400 <../selected_assignment_rules.html#selected-assignment-400>`_ * `sequential_004 <../sequential_rules.html#sequential-004>`_ diff --git a/vsg/rules/protected_type_body/rule_401.py b/vsg/rules/protected_type_body/rule_401.py index 8f79f346..04b759ef 100644 --- a/vsg/rules/protected_type_body/rule_401.py +++ b/vsg/rules/protected_type_body/rule_401.py @@ -28,25 +28,25 @@ class rule_401(Rule): .. code-block:: vhdl - package my_package is + type my_type protected body is signal wr_en : std_logic; signal rd_en : std_logic; constant c_period : time; - end package my_package; + end protected body; **Fix** .. code-block:: vhdl - package my_package is + type my_type protected body is signal wr_en : std_logic; signal rd_en : std_logic; constant c_period : time; - end package my_package; + end protected body; """ def __init__(self):