vhdl-style-guide/vsg/rules/function/rule_006.py

37 lines
824 B
Python

from vsg.rules import previous_line
from vsg.token import function_specification as token
lTokens = []
lTokens.append(token.function_keyword)
lTokens.append(token.pure_keyword)
lTokens.append(token.impure_keyword)
class rule_006(previous_line):
'''
This rule checks for blank lines or comments above the **function** keyword.
Refer to `Configuring Previous Line Rules <configuring.html#configuring-previous-line-rules>`_ for options.
**Violation**
.. code-block:: vhdl
architecture RTL of FIFO is
function overflow (a: integer) return integer is
**Fix**
.. code-block:: vhdl
architecture RTL of FIFO is
function overflow (a: integer) return integer is
'''
def __init__(self):
previous_line.__init__(self, 'function', '006', lTokens)