Issue#1287: Added documentation for alignment rules for protected type body

This commit is contained in:
JHertz5 2024-10-24 21:57:39 +01:00
parent 28d3232481
commit 5ca74da98e
5 changed files with 91 additions and 4 deletions

View File

@ -148,3 +148,4 @@ Rules Enforcing Identifier Alignment
* `package_019 <package_rules.html#package-019>`_
* `package_body_400 <package_body_rules.html#package-body-400>`_
* `procedure_010 <procedure_rules.html#procedure-010>`_
* `protected_type_body_400 <protected_type_body_rules.html#protected-type-body-400>`_

View File

@ -986,6 +986,8 @@ Rules Enforcing Keyword Alignment
* `process_035 <process_rules.html#process-035>`_
* `process_400 <process_rules.html#process-400>`_
* `process_401 <process_rules.html#process-401>`_
* `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>`_
* `sequential_400 <sequential_rules.html#sequential-400>`_
* `subprogram_body_400 <subprogram_body_rules.html#subprogram-body-400>`_
* `subprogram_body_401 <subprogram_body_rules.html#subprogram-body-401>`_

View File

@ -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
#######################

View File

@ -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>`_

View File

@ -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):