vhdl-style-guide/vsg/rules/variable/rule_018.py

37 lines
750 B
Python

# -*- coding: utf-8 -*-
from vsg import token
from vsg.rules import move_token_left_to_next_non_whitespace_token as Rule
lTokens = []
lTokens.append(token.variable_declaration.assignment_operator)
class rule_018(Rule):
"""
This rule checks the **:=** is on the same line as the **variable** keyword.
**Violation**
.. code-block:: vhdl
variable size : integer
:= 1;
variable width : integer
:= 32;
**Fix**
.. code-block:: vhdl
variable size : integer :=
1;
variable width : integer :=
32;
"""
def __init__(self):
super().__init__(lTokens)
self.bRemoveTrailingWhitespace = False
self.solution = "Move := operator"