Skip to content

Commit cc92d1c

Browse files
committed
Issue#1511: Added docs for new rule to enforce position of assignment operator in variable declarations.
1 parent ce4e5c6 commit cc92d1c

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

docs/rule_groups/structure_rule_group.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ Rules Enforcing Structure Rule Group
188188
* `variable_007 <../variable_rules.html#variable-007>`_
189189
* `variable_015 <../variable_rules.html#variable-015>`_
190190
* `variable_017 <../variable_rules.html#variable-017>`_
191+
* `variable_018 <../variable_rules.html#variable-018>`_
191192
* `variable_assignment_006 <../variable_assignment_rules.html#variable-assignment-006>`_
192193
* `variable_assignment_007 <../variable_assignment_rules.html#variable-assignment-007>`_
193194
* `variable_assignment_008 <../variable_assignment_rules.html#variable-assignment-008>`_

docs/variable_rules.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,31 @@ This rule checks the structure of variable constraints.
301301
element2(3 downto 0)
302302
);
303303
304+
variable_018
305+
############
306+
307+
|phase_1| |error| |structure|
308+
309+
This rule checks the **:=** is on the same line as the **variable** keyword.
310+
311+
**Violation**
312+
313+
.. code-block:: vhdl
314+
315+
variable size : integer
316+
:= 1;
317+
variable width : integer
318+
:= 32;
319+
320+
**Fix**
321+
322+
.. code-block:: vhdl
323+
324+
variable size : integer :=
325+
1;
326+
variable width : integer :=
327+
32
328+
304329
variable_100
305330
############
306331

vsg/rules/variable/rule_018.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class rule_018(Rule):
1111
"""
12-
This rule checks the **:=** is on the same line at the **variable** keyword.
12+
This rule checks the **:=** is on the same line as the **variable** keyword.
1313
1414
**Violation**
1515

0 commit comments

Comments
 (0)