Repository: jeremiah-c-leary/vhdl-style-guide (language: python)

Issue:
Rule `variable_011` does not enforce on procedure calls
**Environment**
v3.27.0

**Describe the bug**
The rule `variable_011` enforces consistent case for variables. However, this does not work on cases where a variable is used in a procedure call.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a file called test.vhd with the following contents:
```vhdl
ARCHITECTURE RTL OF TEST IS

  PROCEDURE MY_PROC (
    SIGNAL PARAM1   : INTEGER;
    VARIABLE PARAM2 : INTEGER
  ) IS
  BEGIN

  END PROCEDURE MY_PROC;

  SIGNAL SIG1 : INTEGER;

BEGIN

  PROCESS1 : PROCESS IS

    VARIABLE VAR1 : INTEGER;

  BEGIN

    MY_PROC(
            PARAM1 => SIG1,
            PARAM2 => VAR1
          );

  END PROCESS PROCESS1;

END ARCHITECTURE RTL;
```
2. Run `vsg -f test.vhd --fix`
3. Read test.vhd again
```vhdl
architecture rtl of test is

  procedure my_proc (
    signal param1   : integer;
    variable param2 : integer
  ) is
  begin

  end procedure my_proc;

  signal sig1 : integer;

begin

  process1 : process is

    variable var1 : integer;

  begin

    my_proc(
            param1 => sig1,
            param2 => VAR1
          );

  end process process1;

end architecture rtl;
```
All of the code other than the variable name in the procedure call has been corrected to lowercase.

**Expected behavior**
I expect this rule to act on variable names in procedure calls.



Discussion / hints:

Fix patch:
diff --git a/vsg/rules/variable/rule_011.py b/vsg/rules/variable/rule_011.py
index c1e2f9f76..a0ea6501a 100644
--- a/vsg/rules/variable/rule_011.py
+++ b/vsg/rules/variable/rule_011.py
@@ -12,6 +12,7 @@
 lNames.append(token.simple_variable_assignment.target)
 lNames.append(token.selected_variable_assignment.target)
 lNames.append(token.conditional_variable_assignment.target)
+lNames.append(token.association_element.actual_part)
 
 
 class rule_011(Rule):


Test patch:
diff --git a/tests/variable/rule_011_test_input.fixed.vhd b/tests/variable/rule_011_test_input.fixed.vhd
index ddc6776d3..bd3887c72 100644
--- a/tests/variable/rule_011_test_input.fixed.vhd
+++ b/tests/variable/rule_011_test_input.fixed.vhd
@@ -465,3 +465,36 @@ package body pkg_test is
   end function function2;
 
 end package body pkg_test;
+
+--=============================================================================
+-- Issue #1335 test
+--=============================================================================
+
+architecture rtl of test is
+
+  procedure my_proc (
+    signal param1   : integer;
+    variable param2 : integer
+  ) is
+  begin
+
+  end procedure my_proc;
+
+  signal sig1 : integer;
+
+begin
+
+  process1 : process is
+
+    variable var1 : integer;
+
+  begin
+
+    my_proc(
+            param1 => SIG1,
+            param2 => var1
+          );
+
+  end process process1;
+
+end architecture rtl;
diff --git a/tests/variable/rule_011_test_input.vhd b/tests/variable/rule_011_test_input.vhd
index 1d2d8b112..7d5dc3470 100644
--- a/tests/variable/rule_011_test_input.vhd
+++ b/tests/variable/rule_011_test_input.vhd
@@ -465,3 +465,36 @@ package body pkg_test is
   end function function2;
 
 end package body pkg_test;
+
+--=============================================================================
+-- Issue #1335 test
+--=============================================================================
+
+architecture rtl of test is
+
+  procedure my_proc (
+    signal param1   : integer;
+    variable param2 : integer
+  ) is
+  begin
+
+  end procedure my_proc;
+
+  signal sig1 : integer;
+
+begin
+
+  process1 : process is
+
+    variable var1 : integer;
+
+  begin
+
+    my_proc(
+            param1 => SIG1,
+            param2 => VAR1
+          );
+
+  end process process1;
+
+end architecture rtl;
diff --git a/tests/variable/test_rule_011.py b/tests/variable/test_rule_011.py
index 6e6444788..6a37a10a8 100644
--- a/tests/variable/test_rule_011.py
+++ b/tests/variable/test_rule_011.py
@@ -44,6 +44,7 @@ def test_rule_011(self):
         lExpected.extend([287, 287, 287, 287, 290])
         lExpected.extend([321, 321, 321, 321, 324])
         lExpected.extend([331, 331, 331, 331, 334])
+        lExpected.extend([495])
 
         oRule.analyze(self.oFile)
         self.assertEqual(lExpected, utils.extract_violation_lines_from_violation_object(oRule.violations))