From 2be4bd6a01ad8abbc2afcee3e2ebb72d29cceef5 Mon Sep 17 00:00:00 2001 From: Jeremiah Leary Date: Fri, 27 Nov 2020 08:19:19 -0600 Subject: [PATCH] Adjusting subphase for constant_012 and constant_014 to ensure they run last in alignments. --- vsg/rules/constant/rule_012.py | 1 + vsg/rules/constant/rule_014.py | 1 + vsg/tests/constant/rule_014_test_input.fixed.vhd | 8 ++++++-- vsg/tests/constant/rule_014_test_input.vhd | 8 ++++++-- vsg/tests/constant/test_rule_014.py | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/vsg/rules/constant/rule_012.py b/vsg/rules/constant/rule_012.py index eb4699f8..87e5cedc 100644 --- a/vsg/rules/constant/rule_012.py +++ b/vsg/rules/constant/rule_012.py @@ -32,6 +32,7 @@ class rule_012(rule.Rule): rule.Rule.__init__(self, 'constant', '012') self.solution = 'Align one space after assignment operator' self.phase = 5 + self.subphase = 4 self.lTokenPairs = lTokenPairs self.bExcludeLastToken = False diff --git a/vsg/rules/constant/rule_014.py b/vsg/rules/constant/rule_014.py index 5cad211f..978ca127 100644 --- a/vsg/rules/constant/rule_014.py +++ b/vsg/rules/constant/rule_014.py @@ -32,6 +32,7 @@ class rule_014(rule.Rule): rule.Rule.__init__(self, 'constant', '014') self.solution = 'Align one space after assignment operator' self.phase = 5 + self.subphase = 4 self.lTokenPairs = lTokenPairs self.bExcludeLastToken = False diff --git a/vsg/tests/constant/rule_014_test_input.fixed.vhd b/vsg/tests/constant/rule_014_test_input.fixed.vhd index 8daca6cb..b43463cd 100644 --- a/vsg/tests/constant/rule_014_test_input.fixed.vhd +++ b/vsg/tests/constant/rule_014_test_input.fixed.vhd @@ -3,6 +3,9 @@ architecture RTL of FIFO is constant con1 : integer := a + b + c + d; + constant con1 : integer := + a + b + c + d; + constant con2 : integer := a + b + c + d; @@ -24,14 +27,15 @@ architecture RTL of FIFO is -- Violations - constant con1 : integer := a + b + c + d; - constant con2 : integer := a + b + c + d; constant con2 : integer := a + b + c + d; + constant con1 : integer := + a + b + c + d; + constant con3 : integer := ( 0, diff --git a/vsg/tests/constant/rule_014_test_input.vhd b/vsg/tests/constant/rule_014_test_input.vhd index 59bff04c..89fc0c36 100644 --- a/vsg/tests/constant/rule_014_test_input.vhd +++ b/vsg/tests/constant/rule_014_test_input.vhd @@ -3,6 +3,9 @@ architecture RTL of FIFO is constant con1 : integer := a + b + c + d; + constant con1 : integer := + a + b + c + d; + constant con2 : integer := a + b + c + d; @@ -24,14 +27,15 @@ architecture RTL of FIFO is -- Violations - constant con1 : integer := a + b + c + d; - constant con2 : integer := a + b + c + d; constant con2 : integer := a + b + c + d; + constant con1 : integer := + a + b + c + d; + constant con3 : integer := ( 0, diff --git a/vsg/tests/constant/test_rule_014.py b/vsg/tests/constant/test_rule_014.py index aa05dee3..6b6790d1 100644 --- a/vsg/tests/constant/test_rule_014.py +++ b/vsg/tests/constant/test_rule_014.py @@ -26,7 +26,7 @@ class test_constant_rule(unittest.TestCase): self.assertEqual(oRule.name, 'constant') self.assertEqual(oRule.identifier, '014') - lExpected = [30, 33] + lExpected = [31, 34, 37] oRule.analyze(self.oFile) self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))