diff --git a/docs/configuring_whitespace_rules.rst b/docs/configuring_whitespace_rules.rst index bb9cc140a..4e41ca130 100644 --- a/docs/configuring_whitespace_rules.rst +++ b/docs/configuring_whitespace_rules.rst @@ -161,6 +161,8 @@ Rules Enforcing Whitespace * `constant_010 `_ * `constant_100 `_ * `constant_101 `_ +* `constrained_array_definition_100 `_ +* `constrained_array_definition_101 `_ * `context_002 `_ * `context_017 `_ * `context_018 `_ @@ -285,6 +287,9 @@ Rules Enforcing Whitespace * `type_006 `_ * `type_007 `_ * `type_100 `_ +* `unbounded_array_definition_100 `_ +* `unbounded_array_definition_101 `_ +* `unbounded_array_definition_102 `_ * `variable_005 `_ * `variable_006 `_ * `variable_100 `_ diff --git a/docs/constrained_array_definition_rules.rst b/docs/constrained_array_definition_rules.rst index 2d457be2d..7f78c05d8 100644 --- a/docs/constrained_array_definition_rules.rst +++ b/docs/constrained_array_definition_rules.rst @@ -3,6 +3,48 @@ Constrained Array Definition Rules ---------------------------------- +constrained_array_definition_100 +################################ + +|phase_2| |error| |whitespace| + +This rule checks for a single space before the **of** keyword. + +|configuring_whitespace_rules_link| + +**Violation** + +.. code-block:: vhdl + + type t_u_array is array(1 downto 0) of unsigned; + +**Fix** + +.. code-block:: vhdl + + type t_u_array is array(1 downto 0) of unsigned; + +constrained_array_definition_101 +################################ + +|phase_2| |error| |whitespace| + +This rule checks for a single space after the **of** keyword. + +|configuring_whitespace_rules_link| + +**Violation** + +.. code-block:: vhdl + + type t_u_array is array(1 downto 0) of unsigned; + +**Fix** + +.. code-block:: vhdl + + type t_u_array is array(1 downto 0) of unsigned; + constrained_array_definition_500 ################################ diff --git a/docs/rule_groups/whitespace_rule_group.rst b/docs/rule_groups/whitespace_rule_group.rst index ac52e45e4..08a4e2cb2 100644 --- a/docs/rule_groups/whitespace_rule_group.rst +++ b/docs/rule_groups/whitespace_rule_group.rst @@ -55,6 +55,8 @@ Rules Enforcing Whitespace Rule Group * `constant_010 <../constant_rules.html#constant-010>`_ * `constant_100 <../constant_rules.html#constant-100>`_ * `constant_101 <../constant_rules.html#constant-101>`_ +* `constrained_array_definition_100 <../constrained_array_definition_rules.html#constrained-array-definition-100>`_ +* `constrained_array_definition_101 <../constrained_array_definition_rules.html#constrained-array-definition-101>`_ * `context_002 <../context_rules.html#context-002>`_ * `context_017 <../context_rules.html#context-017>`_ * `context_018 <../context_rules.html#context-018>`_ @@ -182,6 +184,9 @@ Rules Enforcing Whitespace Rule Group * `type_006 <../type_rules.html#type-006>`_ * `type_007 <../type_rules.html#type-007>`_ * `type_100 <../type_rules.html#type-100>`_ +* `unbounded_array_definition_100 <../unbounded_array_definition_rules.html#unbounded-array-definition-100>`_ +* `unbounded_array_definition_101 <../unbounded_array_definition_rules.html#unbounded-array-definition-101>`_ +* `unbounded_array_definition_102 <../unbounded_array_definition_rules.html#unbounded-array-definition-102>`_ * `variable_005 <../variable_rules.html#variable-005>`_ * `variable_006 <../variable_rules.html#variable-006>`_ * `variable_100 <../variable_rules.html#variable-100>`_ diff --git a/docs/unbounded_array_definition_rules.rst b/docs/unbounded_array_definition_rules.rst index a9a75a0dd..8b8c3da6c 100644 --- a/docs/unbounded_array_definition_rules.rst +++ b/docs/unbounded_array_definition_rules.rst @@ -3,6 +3,71 @@ Unbounded Array Definition Rules -------------------------------- +unbounded_array_definition_100 +############################## + +|phase_2| |error| |whitespace| + +This rule checks for whitespace after the **array** keyword. + +|configuring_whitespace_rules_link| + +**Violation** + +.. code-block:: vhdl + + type t_u_array_unconstrained is array (natural range <>) of unsigned; + type t_u_array_unconstrained is array (natural range <>) of unsigned; + +**Fix** + +.. code-block:: vhdl + + type t_u_array_unconstrained is array(natural range <>) of unsigned; + type t_u_array_unconstrained is array(natural range <>) of unsigned; + +unbounded_array_definition_101 +############################## + +|phase_2| |error| |whitespace| + +This rule checks for a single space before the **of** keyword. + +|configuring_whitespace_rules_link| + +**Violation** + +.. code-block:: vhdl + + type t_u_array_unconstrained is array(natural range <>) of unsigned; + +**Fix** + +.. code-block:: vhdl + + type t_u_array_unconstrained is array(natural range <>) of unsigned; + +unbounded_array_definition_102 +############################## + +|phase_2| |error| |whitespace| + +This rule checks for a single space after the **of** keyword. + +|configuring_whitespace_rules_link| + +**Violation** + +.. code-block:: vhdl + + type t_u_array_unconstrained is array(natural range <>) of unsigned; + +**Fix** + +.. code-block:: vhdl + + type t_u_array_unconstrained is array(natural range <>) of unsigned; + unbounded_array_definition_500 ############################## diff --git a/tests/constrained_array_definition/rule_100_test_input.fixed.vhd b/tests/constrained_array_definition/rule_100_test_input.fixed.vhd new file mode 100644 index 000000000..147a27348 --- /dev/null +++ b/tests/constrained_array_definition/rule_100_test_input.fixed.vhd @@ -0,0 +1,12 @@ + +architecture RTL of FIFO is + + type my_array is array(natural range 0 to 7) of std_logic_vector(7 downto 0); + type my_array is array(natural range 0 to 7) of std_logic_vector(7 downto 0); + + type my_array is array(0 to 7) of std_logic_vector(7 downto 0); + type my_array is array(0 to 7) of std_logic_vector(7 downto 0); + +begin + +end architecture RTL; diff --git a/tests/constrained_array_definition/rule_100_test_input.vhd b/tests/constrained_array_definition/rule_100_test_input.vhd new file mode 100644 index 000000000..8e3174f40 --- /dev/null +++ b/tests/constrained_array_definition/rule_100_test_input.vhd @@ -0,0 +1,12 @@ + +architecture RTL of FIFO is + + type my_array is array(natural range 0 to 7) of std_logic_vector(7 downto 0); + type my_array is array(natural range 0 to 7) of std_logic_vector(7 downto 0); + + type my_array is array(0 to 7) of std_logic_vector(7 downto 0); + type my_array is array(0 to 7) of std_logic_vector(7 downto 0); + +begin + +end architecture RTL; diff --git a/tests/constrained_array_definition/rule_101_test_input.fixed.vhd b/tests/constrained_array_definition/rule_101_test_input.fixed.vhd new file mode 100644 index 000000000..147a27348 --- /dev/null +++ b/tests/constrained_array_definition/rule_101_test_input.fixed.vhd @@ -0,0 +1,12 @@ + +architecture RTL of FIFO is + + type my_array is array(natural range 0 to 7) of std_logic_vector(7 downto 0); + type my_array is array(natural range 0 to 7) of std_logic_vector(7 downto 0); + + type my_array is array(0 to 7) of std_logic_vector(7 downto 0); + type my_array is array(0 to 7) of std_logic_vector(7 downto 0); + +begin + +end architecture RTL; diff --git a/tests/constrained_array_definition/rule_101_test_input.vhd b/tests/constrained_array_definition/rule_101_test_input.vhd new file mode 100644 index 000000000..856a74551 --- /dev/null +++ b/tests/constrained_array_definition/rule_101_test_input.vhd @@ -0,0 +1,12 @@ + +architecture RTL of FIFO is + + type my_array is array(natural range 0 to 7) of std_logic_vector(7 downto 0); + type my_array is array(natural range 0 to 7) of std_logic_vector(7 downto 0); + + type my_array is array(0 to 7) of std_logic_vector(7 downto 0); + type my_array is array(0 to 7) of std_logic_vector(7 downto 0); + +begin + +end architecture RTL; diff --git a/tests/constrained_array_definition/test_rule_100.py b/tests/constrained_array_definition/test_rule_100.py new file mode 100644 index 000000000..3d522bfe1 --- /dev/null +++ b/tests/constrained_array_definition/test_rule_100.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- + +import os +import unittest + +from tests import utils +from vsg import vhdlFile +from vsg.rules import constrained_array_definition + +sTestDir = os.path.dirname(__file__) + +lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_100_test_input.vhd")) + +dIndentMap = utils.read_indent_file() + +lExpected = [] +lExpected.append("") +utils.read_file(os.path.join(sTestDir, "rule_100_test_input.fixed.vhd"), lExpected) + + +class test_rule(unittest.TestCase): + def setUp(self): + self.oFile = vhdlFile.vhdlFile(lFile) + self.assertIsNone(eError) + self.oFile.set_indent_map(dIndentMap) + + def test_rule_100(self): + oRule = constrained_array_definition.rule_100() + self.assertTrue(oRule) + self.assertEqual(oRule.name, "constrained_array_definition") + self.assertEqual(oRule.identifier, "100") + + lExpected = [4, 7] + + oRule.analyze(self.oFile) + self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations)) + + def test_fix_rule_100(self): + oRule = constrained_array_definition.rule_100() + + oRule.fix(self.oFile) + + lActual = self.oFile.get_lines() + + self.assertEqual(lExpected, lActual) + + oRule.analyze(self.oFile) + self.assertEqual(oRule.violations, []) diff --git a/tests/constrained_array_definition/test_rule_101.py b/tests/constrained_array_definition/test_rule_101.py new file mode 100644 index 000000000..d57ba2579 --- /dev/null +++ b/tests/constrained_array_definition/test_rule_101.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- + +import os +import unittest + +from tests import utils +from vsg import vhdlFile +from vsg.rules import constrained_array_definition + +sTestDir = os.path.dirname(__file__) + +lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_101_test_input.vhd")) + +dIndentMap = utils.read_indent_file() + +lExpected = [] +lExpected.append("") +utils.read_file(os.path.join(sTestDir, "rule_101_test_input.fixed.vhd"), lExpected) + + +class test_rule(unittest.TestCase): + def setUp(self): + self.oFile = vhdlFile.vhdlFile(lFile) + self.assertIsNone(eError) + self.oFile.set_indent_map(dIndentMap) + + def test_rule_101(self): + oRule = constrained_array_definition.rule_101() + self.assertTrue(oRule) + self.assertEqual(oRule.name, "constrained_array_definition") + self.assertEqual(oRule.identifier, "101") + + lExpected = [4, 7] + + oRule.analyze(self.oFile) + self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations)) + + def test_fix_rule_101(self): + oRule = constrained_array_definition.rule_101() + + oRule.fix(self.oFile) + + lActual = self.oFile.get_lines() + + self.assertEqual(lExpected, lActual) + + oRule.analyze(self.oFile) + self.assertEqual(oRule.violations, []) diff --git a/tests/unbounded_array_definition/rule_100_test_input.fixed.vhd b/tests/unbounded_array_definition/rule_100_test_input.fixed.vhd new file mode 100644 index 000000000..f5298f35e --- /dev/null +++ b/tests/unbounded_array_definition/rule_100_test_input.fixed.vhd @@ -0,0 +1,10 @@ + +architecture RTL of FIFO is + + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + +begin + +end architecture RTL; diff --git a/tests/unbounded_array_definition/rule_100_test_input.vhd b/tests/unbounded_array_definition/rule_100_test_input.vhd new file mode 100644 index 000000000..e038e034b --- /dev/null +++ b/tests/unbounded_array_definition/rule_100_test_input.vhd @@ -0,0 +1,10 @@ + +architecture RTL of FIFO is + + type my_array is array (natural range <>) of std_logic_vector(7 downto 0); + type my_array is array (natural range <>) of std_logic_vector(7 downto 0); + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + +begin + +end architecture RTL; diff --git a/tests/unbounded_array_definition/rule_101_test_input.fixed.vhd b/tests/unbounded_array_definition/rule_101_test_input.fixed.vhd new file mode 100644 index 000000000..332dc734b --- /dev/null +++ b/tests/unbounded_array_definition/rule_101_test_input.fixed.vhd @@ -0,0 +1,9 @@ + +architecture RTL of FIFO is + + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + +begin + +end architecture RTL; diff --git a/tests/unbounded_array_definition/rule_101_test_input.vhd b/tests/unbounded_array_definition/rule_101_test_input.vhd new file mode 100644 index 000000000..86af5a7ed --- /dev/null +++ b/tests/unbounded_array_definition/rule_101_test_input.vhd @@ -0,0 +1,9 @@ + +architecture RTL of FIFO is + + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + +begin + +end architecture RTL; diff --git a/tests/unbounded_array_definition/rule_102_test_input.fixed.vhd b/tests/unbounded_array_definition/rule_102_test_input.fixed.vhd new file mode 100644 index 000000000..332dc734b --- /dev/null +++ b/tests/unbounded_array_definition/rule_102_test_input.fixed.vhd @@ -0,0 +1,9 @@ + +architecture RTL of FIFO is + + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + +begin + +end architecture RTL; diff --git a/tests/unbounded_array_definition/rule_102_test_input.vhd b/tests/unbounded_array_definition/rule_102_test_input.vhd new file mode 100644 index 000000000..ac1336304 --- /dev/null +++ b/tests/unbounded_array_definition/rule_102_test_input.vhd @@ -0,0 +1,9 @@ + +architecture RTL of FIFO is + + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + type my_array is array(natural range <>) of std_logic_vector(7 downto 0); + +begin + +end architecture RTL; diff --git a/tests/unbounded_array_definition/test_rule_100.py b/tests/unbounded_array_definition/test_rule_100.py new file mode 100644 index 000000000..005d2d01a --- /dev/null +++ b/tests/unbounded_array_definition/test_rule_100.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- + +import os +import unittest + +from tests import utils +from vsg import vhdlFile +from vsg.rules import unbounded_array_definition + +sTestDir = os.path.dirname(__file__) + +lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_100_test_input.vhd")) + +dIndentMap = utils.read_indent_file() + +lExpected = [] +lExpected.append("") +utils.read_file(os.path.join(sTestDir, "rule_100_test_input.fixed.vhd"), lExpected) + + +class test_rule(unittest.TestCase): + def setUp(self): + self.oFile = vhdlFile.vhdlFile(lFile) + self.assertIsNone(eError) + self.oFile.set_indent_map(dIndentMap) + + def test_rule_100(self): + oRule = unbounded_array_definition.rule_100() + self.assertTrue(oRule) + self.assertEqual(oRule.name, "unbounded_array_definition") + self.assertEqual(oRule.identifier, "100") + + lExpected = [4, 5] + + oRule.analyze(self.oFile) + self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations)) + + def test_fix_rule_100(self): + oRule = unbounded_array_definition.rule_100() + + oRule.fix(self.oFile) + + lActual = self.oFile.get_lines() + + self.assertEqual(lExpected, lActual) + + oRule.analyze(self.oFile) + self.assertEqual(oRule.violations, []) diff --git a/tests/unbounded_array_definition/test_rule_101.py b/tests/unbounded_array_definition/test_rule_101.py new file mode 100644 index 000000000..a50a0a140 --- /dev/null +++ b/tests/unbounded_array_definition/test_rule_101.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- + +import os +import unittest + +from tests import utils +from vsg import vhdlFile +from vsg.rules import unbounded_array_definition + +sTestDir = os.path.dirname(__file__) + +lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_101_test_input.vhd")) + +dIndentMap = utils.read_indent_file() + +lExpected = [] +lExpected.append("") +utils.read_file(os.path.join(sTestDir, "rule_101_test_input.fixed.vhd"), lExpected) + + +class test_rule(unittest.TestCase): + def setUp(self): + self.oFile = vhdlFile.vhdlFile(lFile) + self.assertIsNone(eError) + self.oFile.set_indent_map(dIndentMap) + + def test_rule_101(self): + oRule = unbounded_array_definition.rule_101() + self.assertTrue(oRule) + self.assertEqual(oRule.name, "unbounded_array_definition") + self.assertEqual(oRule.identifier, "101") + + lExpected = [4] + + oRule.analyze(self.oFile) + self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations)) + + def test_fix_rule_101(self): + oRule = unbounded_array_definition.rule_101() + + oRule.fix(self.oFile) + + lActual = self.oFile.get_lines() + + self.assertEqual(lExpected, lActual) + + oRule.analyze(self.oFile) + self.assertEqual(oRule.violations, []) diff --git a/tests/unbounded_array_definition/test_rule_102.py b/tests/unbounded_array_definition/test_rule_102.py new file mode 100644 index 000000000..bcea6c602 --- /dev/null +++ b/tests/unbounded_array_definition/test_rule_102.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- + +import os +import unittest + +from tests import utils +from vsg import vhdlFile +from vsg.rules import unbounded_array_definition + +sTestDir = os.path.dirname(__file__) + +lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_102_test_input.vhd")) + +dIndentMap = utils.read_indent_file() + +lExpected = [] +lExpected.append("") +utils.read_file(os.path.join(sTestDir, "rule_102_test_input.fixed.vhd"), lExpected) + + +class test_rule(unittest.TestCase): + def setUp(self): + self.oFile = vhdlFile.vhdlFile(lFile) + self.assertIsNone(eError) + self.oFile.set_indent_map(dIndentMap) + + def test_rule_102(self): + oRule = unbounded_array_definition.rule_102() + self.assertTrue(oRule) + self.assertEqual(oRule.name, "unbounded_array_definition") + self.assertEqual(oRule.identifier, "102") + + lExpected = [4] + + oRule.analyze(self.oFile) + self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations)) + + def test_fix_rule_102(self): + oRule = unbounded_array_definition.rule_102() + + oRule.fix(self.oFile) + + lActual = self.oFile.get_lines() + + self.assertEqual(lExpected, lActual) + + oRule.analyze(self.oFile) + self.assertEqual(oRule.violations, []) diff --git a/vsg/rules/constrained_array_definition/__init__.py b/vsg/rules/constrained_array_definition/__init__.py index 3c6ea275b..a1f7e96d1 100644 --- a/vsg/rules/constrained_array_definition/__init__.py +++ b/vsg/rules/constrained_array_definition/__init__.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +from .rule_100 import rule_100 +from .rule_101 import rule_101 from .rule_500 import rule_500 from .rule_501 import rule_501 diff --git a/vsg/rules/constrained_array_definition/rule_100.py b/vsg/rules/constrained_array_definition/rule_100.py new file mode 100644 index 000000000..33d278c81 --- /dev/null +++ b/vsg/rules/constrained_array_definition/rule_100.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +from vsg import token +from vsg.rules.whitespace_before_token import Rule + +lTokens = [] +lTokens.append(token.constrained_array_definition.of_keyword) + + +class rule_100(Rule): + """ + This rule checks for a single space before the **of** keyword. + + |configuring_whitespace_rules_link| + + **Violation** + + .. code-block:: vhdl + + type t_u_array is array(1 downto 0) of unsigned; + + **Fix** + + .. code-block:: vhdl + + type t_u_array is array(1 downto 0) of unsigned; + """ + + def __init__(self): + super().__init__(lTokens) + self.number_of_spaces = 1 diff --git a/vsg/rules/constrained_array_definition/rule_101.py b/vsg/rules/constrained_array_definition/rule_101.py new file mode 100644 index 000000000..26ae83613 --- /dev/null +++ b/vsg/rules/constrained_array_definition/rule_101.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +from vsg import token +from vsg.rules.whitespace_after_token import Rule + +lTokens = [] +lTokens.append(token.constrained_array_definition.of_keyword) + + +class rule_101(Rule): + """ + This rule checks for a single space after the **of** keyword. + + |configuring_whitespace_rules_link| + + **Violation** + + .. code-block:: vhdl + + type t_u_array is array(1 downto 0) of unsigned; + + **Fix** + + .. code-block:: vhdl + + type t_u_array is array(1 downto 0) of unsigned; + """ + + def __init__(self): + super().__init__(lTokens) + self.number_of_spaces = 1 diff --git a/vsg/rules/unbounded_array_definition/__init__.py b/vsg/rules/unbounded_array_definition/__init__.py index 3c6ea275b..09808f1e6 100644 --- a/vsg/rules/unbounded_array_definition/__init__.py +++ b/vsg/rules/unbounded_array_definition/__init__.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +from .rule_100 import rule_100 +from .rule_101 import rule_101 +from .rule_102 import rule_102 from .rule_500 import rule_500 from .rule_501 import rule_501 diff --git a/vsg/rules/unbounded_array_definition/rule_100.py b/vsg/rules/unbounded_array_definition/rule_100.py new file mode 100644 index 000000000..13d154f13 --- /dev/null +++ b/vsg/rules/unbounded_array_definition/rule_100.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +from vsg import token +from vsg.rules.whitespace_after_token import Rule + +lTokens = [] +lTokens.append(token.unbounded_array_definition.array_keyword) + + +class rule_100(Rule): + """ + This rule checks for whitespace after the **array** keyword. + + |configuring_whitespace_rules_link| + + **Violation** + + .. code-block:: vhdl + + type t_u_array_unconstrained is array (natural range <>) of unsigned; + type t_u_array_unconstrained is array (natural range <>) of unsigned; + + **Fix** + + .. code-block:: vhdl + + type t_u_array_unconstrained is array(natural range <>) of unsigned; + type t_u_array_unconstrained is array(natural range <>) of unsigned; + """ + + def __init__(self): + super().__init__(lTokens) + self.number_of_spaces = 0 diff --git a/vsg/rules/unbounded_array_definition/rule_101.py b/vsg/rules/unbounded_array_definition/rule_101.py new file mode 100644 index 000000000..e5b5c5a12 --- /dev/null +++ b/vsg/rules/unbounded_array_definition/rule_101.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +from vsg import token +from vsg.rules.whitespace_before_token import Rule + +lTokens = [] +lTokens.append(token.unbounded_array_definition.of_keyword) + + +class rule_101(Rule): + """ + This rule checks for a single space before the **of** keyword. + + |configuring_whitespace_rules_link| + + **Violation** + + .. code-block:: vhdl + + type t_u_array_unconstrained is array(natural range <>) of unsigned; + + **Fix** + + .. code-block:: vhdl + + type t_u_array_unconstrained is array(natural range <>) of unsigned; + """ + + def __init__(self): + super().__init__(lTokens) + self.number_of_spaces = 1 diff --git a/vsg/rules/unbounded_array_definition/rule_102.py b/vsg/rules/unbounded_array_definition/rule_102.py new file mode 100644 index 000000000..5d75914db --- /dev/null +++ b/vsg/rules/unbounded_array_definition/rule_102.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +from vsg import token +from vsg.rules.whitespace_after_token import Rule + +lTokens = [] +lTokens.append(token.unbounded_array_definition.of_keyword) + + +class rule_102(Rule): + """ + This rule checks for a single space after the **of** keyword. + + |configuring_whitespace_rules_link| + + **Violation** + + .. code-block:: vhdl + + type t_u_array_unconstrained is array(natural range <>) of unsigned; + + **Fix** + + .. code-block:: vhdl + + type t_u_array_unconstrained is array(natural range <>) of unsigned; + """ + + def __init__(self): + super().__init__(lTokens) + self.number_of_spaces = 1