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

Issue:
Rules to enforce case on the `others` keyword in selected assignments
**Is your feature request related to a problem? Please describe.**
I'd like a rule to enforce case on the `others` keyword in selected assignments. For example, I'd like
```vhdl
architecture rtl of fifo is

begin

  my_proc : process (all) is
  begin

    with CONDITION select A <=
      '1' when X,
      '0' when OTHERS;

    with CONDITION select A <=
      '1' when X,
      '0' when OTHERS;

  end process my_proc;

end architecture rtl;
```
corrected to
```vhdl
architecture rtl of fifo is

begin

  my_proc : process (all) is
  begin

    with CONDITION select A <=
      '1' when X,
      '0' when others;

    with CONDITION select A <=
      '1' when X,
      '0' when others;

  end process my_proc;

end architecture rtl;



Discussion / hints:
This suffers from the same complication described here https://github.com/jeremiah-c-leary/vhdl-style-guide/issues/1279#issuecomment-2424766551
There are multiple constructs covered by the `selected_assignment` rules, i.e. 
- `concurrent_selected_signal_assignment`
- `selected_force_assignment`
- `selected_variable_assignment`
- `selected_waveform_assignment`

At the moment, it looks like I'll need to extend or create a variant of `token_case_in_range_bounded_by_tokens` to accept lists of pairs of start and end tokens.
Evening @JHertz5 ,

I did a search for `choice` in the productions and found the following:

![Image](https://github.com/user-attachments/assets/4005cc11-2a0e-4fe1-a267-0055bac16abf)

I also ran `vsg_parser` on your example and the `others` keyword is part of the `choice` production:
```mono
--------------------------------------------------------------------------------
14 |       '0' when OTHERS;
<class 'vsg.parser.character_literal'>
<class 'vsg.token.selected_waveforms.when_keyword'>
<class 'vsg.token.choice.others_keyword'>
<class 'vsg.token.selected_waveform_assignment.semicolon'>
```

We could have a single rule to set the case for the `others` in a `choice` production.

What do you think?

--Jeremy
Hi @jeremiah-c-leary 

I think that's an excellent idea! It simplifies the ruleset, it fits the LRM well, and it makes the implementation trivial. I'll put a PR together for this soon.

Thanks,
Jukka

Fix patch:
diff --git a/docs/aggregate_rules.rst b/docs/aggregate_rules.rst
index 114455d7c..92b5ceb5f 100644
--- a/docs/aggregate_rules.rst
+++ b/docs/aggregate_rules.rst
@@ -6,20 +6,4 @@ Aggregate Rules
 aggregate_500
 #############
 
-|phase_6| |error| |case| |case_keyword|
-
-This rule checks the *others* keyword in aggregates has proper case.
-
-|configuring_uppercase_and_lowercase_rules_link|
-
-**Violation**
-
-.. code-block:: vhdl
-
-   signal counter : t_counter := (OTHERS => '1');
-
-**Fix**
-
-.. code-block:: vhdl
-
-   signal counter : t_counter := (others => '1');
+This rule has been deprecated and replaced with rule `choice_500 <choice_rules.html#choice-500>`_.
diff --git a/docs/case_generate_alternative_rules.rst b/docs/case_generate_alternative_rules.rst
index 71955e9fb..35834b3b5 100644
--- a/docs/case_generate_alternative_rules.rst
+++ b/docs/case_generate_alternative_rules.rst
@@ -32,20 +32,4 @@ This rule checks the *when* keyword has proper case.
 case_generate_alternative_501
 #############################
 
-|phase_6| |error| |case| |case_keyword|
-
-This rule checks the *others* keyword has proper case.
-
-|configuring_uppercase_and_lowercase_rules_link|
-
-**Violation**
-
-.. code-block:: vhdl
-
-   when OTHERS =>
-
-**Fix**
-
-.. code-block:: vhdl
-
-   when others =>
+This rule has been deprecated and replaced with rule `choice_500 <choice_rules.html#choice-500>`_.
diff --git a/docs/case_rules.rst b/docs/case_rules.rst
index 3a278790a..ec03b412e 100644
--- a/docs/case_rules.rst
+++ b/docs/case_rules.rst
@@ -558,20 +558,4 @@ This rule checks the indentation of the label.
 case_500
 ########
 
-|phase_6| |error| |case| |case_keyword|
-
-This rule checks the *others* keyword has proper case.
-
-|configuring_uppercase_and_lowercase_rules_link|
-
-**Violation**
-
-.. code-block:: vhdl
-
-   when OTHERS =>
-
-**Fix**
-
-.. code-block:: vhdl
-
-   when others =>
+This rule has been deprecated and replaced with rule `choice_500 <choice_rules.html#choice-500>`_.
diff --git a/docs/choice_rules.rst b/docs/choice_rules.rst
new file mode 100644
index 000000000..244bce256
--- /dev/null
+++ b/docs/choice_rules.rst
@@ -0,0 +1,25 @@
+.. include:: includes.rst
+
+Choice Rules
+------------
+
+choice_500
+##########
+
+|phase_6| |error| |case| |case_keyword|
+
+This rule checks the **others** keyword has proper case.
+
+|configuring_uppercase_and_lowercase_rules_link|
+
+**Violation**
+
+.. code-block:: vhdl
+
+    '0' when OTHERS;
+
+**Fix**
+
+.. code-block:: vhdl
+
+   '0' when others;
diff --git a/docs/configuring_uppercase_and_lowercase_rules.rst b/docs/configuring_uppercase_and_lowercase_rules.rst
index f90e3520e..3997085fe 100644
--- a/docs/configuring_uppercase_and_lowercase_rules.rst
+++ b/docs/configuring_uppercase_and_lowercase_rules.rst
@@ -221,8 +221,6 @@ For example, if you want to uppercase everything except the entity name, you cou
 Rules Enforcing Case
 ####################
 
-* `aggregate_500 <aggregate_rules.html#aggregate-500>`_
-
 * `alias_declaration_500 <alias_declaration_rules.html#alias-declaration-500>`_
 * `alias_declaration_501 <alias_declaration_rules.html#alias-declaration-501>`_
 * `alias_declaration_502 <alias_declaration_rules.html#alias-declaration-502>`_
@@ -268,14 +266,14 @@ Rules Enforcing Case
 * `case_016 <case_rules.html#case-016>`_
 * `case_017 <case_rules.html#case-017>`_
 * `case_018 <case_rules.html#case-018>`_
-* `case_500 <case_rules.html#case-500>`_
 
 * `case_generate_alternative_500 <case_generate_alternative_rules.html#case-generate-alternative-500>`_
-* `case_generate_alternative_501 <case_generate_alternative_rules.html#case-generate-alternative-501>`_
 
 * `case_generate_statement_500 <case_generate_statement_rules.html#case-generate-statement-500>`_
 * `case_generate_statement_501 <case_generate_statement_rules.html#case-generate-statement-501>`_
 
+* `choice_500 <choice_rules.html#choice-500>`_
+
 * `component_004 <component_rules.html#component-004>`_
 * `component_006 <component_rules.html#component-006>`_
 * `component_008 <component_rules.html#component-008>`_
diff --git a/docs/rule_groups/case_keyword_rule_group.rst b/docs/rule_groups/case_keyword_rule_group.rst
index 5745beac5..34419e351 100644
--- a/docs/rule_groups/case_keyword_rule_group.rst
+++ b/docs/rule_groups/case_keyword_rule_group.rst
@@ -5,7 +5,6 @@ Case::Keyword Rule Group
 Rules Enforcing Case::Keyword Rule Group
 ########################################
 
-* `aggregate_500 <../aggregate_rules.html#aggregate-500>`_
 * `alias_declaration_500 <../alias_declaration_rules.html#alias-declaration-500>`_
 * `alias_declaration_501 <../alias_declaration_rules.html#alias-declaration-501>`_
 * `architecture_004 <../architecture_rules.html#architecture-004>`_
@@ -32,11 +31,10 @@ Rules Enforcing Case::Keyword Rule Group
 * `case_016 <../case_rules.html#case-016>`_
 * `case_017 <../case_rules.html#case-017>`_
 * `case_018 <../case_rules.html#case-018>`_
-* `case_500 <../case_rules.html#case-500>`_
 * `case_generate_alternative_500 <../case_generate_alternative_rules.html#case-generate-alternative-500>`_
-* `case_generate_alternative_501 <../case_generate_alternative_rules.html#case-generate-alternative-501>`_
 * `case_generate_statement_500 <../case_generate_statement_rules.html#case-generate-statement-500>`_
 * `case_generate_statement_501 <../case_generate_statement_rules.html#case-generate-statement-501>`_
+* `choice_500 <../choice_rules.html#choice-500>`_
 * `component_004 <../component_rules.html#component-004>`_
 * `component_006 <../component_rules.html#component-006>`_
 * `component_010 <../component_rules.html#component-010>`_
diff --git a/docs/rule_groups/case_rule_group.rst b/docs/rule_groups/case_rule_group.rst
index c0581aef4..cc7bf2f4d 100644
--- a/docs/rule_groups/case_rule_group.rst
+++ b/docs/rule_groups/case_rule_group.rst
@@ -5,7 +5,6 @@ Case Rule Group
 Rules Enforcing Case Rule Group
 ###############################
 
-* `aggregate_500 <../aggregate_rules.html#aggregate-500>`_
 * `alias_declaration_500 <../alias_declaration_rules.html#alias-declaration-500>`_
 * `alias_declaration_501 <../alias_declaration_rules.html#alias-declaration-501>`_
 * `alias_declaration_502 <../alias_declaration_rules.html#alias-declaration-502>`_
@@ -46,11 +45,10 @@ Rules Enforcing Case Rule Group
 * `case_016 <../case_rules.html#case-016>`_
 * `case_017 <../case_rules.html#case-017>`_
 * `case_018 <../case_rules.html#case-018>`_
-* `case_500 <../case_rules.html#case-500>`_
 * `case_generate_alternative_500 <../case_generate_alternative_rules.html#case-generate-alternative-500>`_
-* `case_generate_alternative_501 <../case_generate_alternative_rules.html#case-generate-alternative-501>`_
 * `case_generate_statement_500 <../case_generate_statement_rules.html#case-generate-statement-500>`_
 * `case_generate_statement_501 <../case_generate_statement_rules.html#case-generate-statement-501>`_
+* `choice_500 <../choice_rules.html#choice-500>`_
 * `component_004 <../component_rules.html#component-004>`_
 * `component_006 <../component_rules.html#component-006>`_
 * `component_008 <../component_rules.html#component-008>`_
diff --git a/docs/rules.rst b/docs/rules.rst
index a89f4d4bf..b4d530045 100644
--- a/docs/rules.rst
+++ b/docs/rules.rst
@@ -20,6 +20,7 @@ The rules are divided into categories depending on the part of the VHDL code bei
    case_rules.rst
    case_generate_alternative_rules.rst
    case_generate_statement_rules.rst
+   choice_rules.rst
    comment_rules.rst
    component_rules.rst
    concurrent_rules.rst
diff --git a/vsg/rules/__init__.py b/vsg/rules/__init__.py
index 341420cd4..0815ef612 100644
--- a/vsg/rules/__init__.py
+++ b/vsg/rules/__init__.py
@@ -112,6 +112,7 @@
 from vsg.rules import case
 from vsg.rules import case_generate_alternative
 from vsg.rules import case_generate_statement
+from vsg.rules import choice
 from vsg.rules import comment
 from vsg.rules import component
 from vsg.rules import concurrent
diff --git a/vsg/rules/aggregate/rule_500.py b/vsg/rules/aggregate/rule_500.py
index fa4814705..54d74f6f9 100644
--- a/vsg/rules/aggregate/rule_500.py
+++ b/vsg/rules/aggregate/rule_500.py
@@ -1,34 +1,13 @@
 # -*- coding: utf-8 -*-
 
-from vsg import token
-from vsg.rules import token_case_in_range_bounded_by_tokens as Rule
-
-lTokens = []
-lTokens.append(token.choice.others_keyword)
-
-oStart = token.aggregate.open_parenthesis
-oEnd = token.aggregate.close_parenthesis
+from vsg.deprecated_rule import Rule
 
 
 class rule_500(Rule):
     """
-    This rule checks the *others* keyword in aggregates has proper case.
-
-    |configuring_uppercase_and_lowercase_rules_link|
-
-    **Violation**
-
-    .. code-block:: vhdl
-
-       signal counter : t_counter := (OTHERS => '1');
-
-    **Fix**
-
-    .. code-block:: vhdl
-
-       signal counter : t_counter := (others => '1');
+    This rule has been deprecated and replaced with rule `choice_500 <choice_rules.html#choice-500>`_.
     """
 
     def __init__(self):
-        super().__init__(lTokens, oStart, oEnd)
-        self.groups.append("case::keyword")
+        Rule.__init__(self)
+        self.message.append("Rule " + self.unique_id + " has been merged into choice_500.")
diff --git a/vsg/rules/case/rule_500.py b/vsg/rules/case/rule_500.py
index 06040d36a..54d74f6f9 100644
--- a/vsg/rules/case/rule_500.py
+++ b/vsg/rules/case/rule_500.py
@@ -1,35 +1,13 @@
 # -*- coding: utf-8 -*-
 
-from vsg import token
-from vsg.rules import token_case_in_range_bounded_by_tokens as Rule
-
-lTokens = []
-lTokens.append(token.choice.others_keyword)
-
-oStartToken = token.case_statement_alternative.when_keyword
-
-oEndToken = token.case_statement_alternative.assignment
+from vsg.deprecated_rule import Rule
 
 
 class rule_500(Rule):
     """
-    This rule checks the *others* keyword has proper case.
-
-    |configuring_uppercase_and_lowercase_rules_link|
-
-    **Violation**
-
-    .. code-block:: vhdl
-
-       when OTHERS =>
-
-    **Fix**
-
-    .. code-block:: vhdl
-
-       when others =>
+    This rule has been deprecated and replaced with rule `choice_500 <choice_rules.html#choice-500>`_.
     """
 
     def __init__(self):
-        super().__init__(lTokens, oStartToken, oEndToken)
-        self.groups.append("case::keyword")
+        Rule.__init__(self)
+        self.message.append("Rule " + self.unique_id + " has been merged into choice_500.")
diff --git a/vsg/rules/case_generate_alternative/rule_501.py b/vsg/rules/case_generate_alternative/rule_501.py
index ed1e1932e..af5b4fd4d 100644
--- a/vsg/rules/case_generate_alternative/rule_501.py
+++ b/vsg/rules/case_generate_alternative/rule_501.py
@@ -1,35 +1,13 @@
 # -*- coding: utf-8 -*-
 
-from vsg import token
-from vsg.rules import token_case_in_range_bounded_by_tokens as Rule
-
-lTokens = []
-lTokens.append(token.choice.others_keyword)
-
-oStartToken = token.case_generate_alternative.when_keyword
-
-oEndToken = token.case_generate_alternative.assignment
+from vsg.deprecated_rule import Rule
 
 
 class rule_501(Rule):
     """
-    This rule checks the *others* keyword has proper case.
-
-    |configuring_uppercase_and_lowercase_rules_link|
-
-    **Violation**
-
-    .. code-block:: vhdl
-
-       when OTHERS =>
-
-    **Fix**
-
-    .. code-block:: vhdl
-
-       when others =>
+    This rule has been deprecated and replaced with rule `choice_500 <choice_rules.html#choice-500>`_.
     """
 
     def __init__(self):
-        super().__init__(lTokens, oStartToken, oEndToken)
-        self.groups.append("case::keyword")
+        Rule.__init__(self)
+        self.message.append("Rule " + self.unique_id + " has been merged into choice_500.")
diff --git a/vsg/rules/choice/__init__.py b/vsg/rules/choice/__init__.py
new file mode 100644
index 000000000..c5c1c6e60
--- /dev/null
+++ b/vsg/rules/choice/__init__.py
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+from .rule_500 import rule_500
diff --git a/vsg/rules/choice/rule_500.py b/vsg/rules/choice/rule_500.py
new file mode 100644
index 000000000..3fe4eb27c
--- /dev/null
+++ b/vsg/rules/choice/rule_500.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+
+from vsg import token
+from vsg.rules import token_case
+
+lTokens = []
+lTokens.append(token.choice.others_keyword)
+
+
+class rule_500(token_case):
+    """
+    This rule checks the **others** keyword has proper case.
+
+    |configuring_uppercase_and_lowercase_rules_link|
+
+    **Violation**
+
+    .. code-block:: vhdl
+
+        '0' when OTHERS;
+
+    **Fix**
+
+    .. code-block:: vhdl
+
+       '0' when others;
+    """
+
+    def __init__(self):
+        super().__init__(lTokens)
+        self.groups.append("case::keyword")


Test patch:
diff --git a/tests/aggregate/rule_500_test_input.fixed_lower.vhd b/tests/aggregate/rule_500_test_input.fixed_lower.vhd
deleted file mode 100644
index b8062a650..000000000
--- a/tests/aggregate/rule_500_test_input.fixed_lower.vhd
+++ /dev/null
@@ -1,148 +0,0 @@
-
-architecture rtl of test is
-
-  signal sig : signed := (others => '0');
-
-  function my_func (
-    test : t_counter := (others => '0')
-  ) return integer is
-  begin
-    return (others => '0');
-  end function;
-
-begin
-
-  a <=
-  (
-    1      => '1',
-    others => '0'
-  );
-  a <= (
-         1 => '1',
-         others => '0'
-       ) when condition else
-       (others => '0');
-  with condition select a <=
-    (others => '1') when x,
-    (others => '0') when others;
-
-  process is
-
-    constant con : signed := (others => '0');
-    variable var : signed := (others => '0');
-
-  begin
-
-    a <=
-    (
-      1      => '1',
-      others => '0'
-    );
-    a <= (
-           1 => '1',
-           others => '0'
-         ) when condition else
-         (others => '0');
-    with condition select a <=
-    (others => '1') when x,
-    (others => '0') when others;
-
-    a :=
-    (
-      1 => '1',
-      others => '0'
-    );
-    a := (
-           1 => '1',
-           others => '0'
-         ) when condition else
-         (others => '0');
-    with condition select a :=
-    (others => '1') when x,
-    (others => '0') when others;
-
-    case expression is
-
-      when others =>
-
-        null;
-
-    end case;
-
-  end process;
-
-end architecture rtl;
-
-architecture rtl of test is
-
-  signal sig : signed := (others => '0');
-
-  function my_func (
-    test : t_counter := (others => '0')
-  ) return integer is
-  begin
-    return (others => '0');
-  end function;
-
-begin
-
-  a <=
-  (
-    1      => '1',
-    others => '0'
-  );
-  a <= (
-         1 => '1',
-         others => '0'
-       ) when condition else
-       (others => '0');
-  with condition select a <=
-    (others => '1') when x,
-    (others => '0') when others;
-
-  process is
-
-    constant con : signed := (others => '0');
-    variable var : signed := (others => '0');
-
-  begin
-
-    a <=
-    (
-      1      => '1',
-      others => '0'
-    );
-    a <= (
-           1 => '1',
-           others => '0'
-         ) when condition else
-         (others => '0');
-    with condition select a <=
-    (others => '1') when x,
-    (others => '0') when others;
-
-    a :=
-    (
-      1 => '1',
-      others => '0'
-    );
-    a := (
-           1 => '1',
-           others => '0'
-         ) when condition else
-         (others => '0');
-    with condition select a :=
-    (others => '1') when x,
-    (others => '0') when others;
-
-    case expression is
-
-      when others =>
-
-        null;
-
-    end case;
-
-  end process;
-
-end architecture rtl;
diff --git a/tests/aggregate/rule_500_test_input.fixed_upper.vhd b/tests/aggregate/rule_500_test_input.fixed_upper.vhd
deleted file mode 100644
index fad935ee1..000000000
--- a/tests/aggregate/rule_500_test_input.fixed_upper.vhd
+++ /dev/null
@@ -1,148 +0,0 @@
-
-architecture rtl of test is
-
-  signal sig : signed := (OTHERS => '0');
-
-  function my_func (
-    test : t_counter := (OTHERS => '0')
-  ) return integer is
-  begin
-    return (OTHERS => '0');
-  end function;
-
-begin
-
-  a <=
-  (
-    1      => '1',
-    OTHERS => '0'
-  );
-  a <= (
-         1 => '1',
-         OTHERS => '0'
-       ) when condition else
-       (OTHERS => '0');
-  with condition select a <=
-    (OTHERS => '1') when x,
-    (OTHERS => '0') when others;
-
-  process is
-
-    constant con : signed := (OTHERS => '0');
-    variable var : signed := (OTHERS => '0');
-
-  begin
-
-    a <=
-    (
-      1      => '1',
-      OTHERS => '0'
-    );
-    a <= (
-           1 => '1',
-           OTHERS => '0'
-         ) when condition else
-         (OTHERS => '0');
-    with condition select a <=
-    (OTHERS => '1') when x,
-    (OTHERS => '0') when others;
-
-    a :=
-    (
-      1 => '1',
-      OTHERS => '0'
-    );
-    a := (
-           1 => '1',
-           OTHERS => '0'
-         ) when condition else
-         (OTHERS => '0');
-    with condition select a :=
-    (OTHERS => '1') when x,
-    (OTHERS => '0') when others;
-
-    case expression is
-
-      when others =>
-
-        null;
-
-    end case;
-
-  end process;
-
-end architecture rtl;
-
-architecture rtl of test is
-
-  signal sig : signed := (OTHERS => '0');
-
-  function my_func (
-    test : t_counter := (OTHERS => '0')
-  ) return integer is
-  begin
-    return (OTHERS => '0');
-  end function;
-
-begin
-
-  a <=
-  (
-    1      => '1',
-    OTHERS => '0'
-  );
-  a <= (
-         1 => '1',
-         OTHERS => '0'
-       ) when condition else
-       (OTHERS => '0');
-  with condition select a <=
-    (OTHERS => '1') when x,
-    (OTHERS => '0') when others;
-
-  process is
-
-    constant con : signed := (OTHERS => '0');
-    variable var : signed := (OTHERS => '0');
-
-  begin
-
-    a <=
-    (
-      1      => '1',
-      OTHERS => '0'
-    );
-    a <= (
-           1 => '1',
-           OTHERS => '0'
-         ) when condition else
-         (OTHERS => '0');
-    with condition select a <=
-    (OTHERS => '1') when x,
-    (OTHERS => '0') when others;
-
-    a :=
-    (
-      1 => '1',
-      OTHERS => '0'
-    );
-    a := (
-           1 => '1',
-           OTHERS => '0'
-         ) when condition else
-         (OTHERS => '0');
-    with condition select a :=
-    (OTHERS => '1') when x,
-    (OTHERS => '0') when others;
-
-    case expression is
-
-      when others =>
-
-        null;
-
-    end case;
-
-  end process;
-
-end architecture rtl;
diff --git a/tests/aggregate/rule_500_test_input.vhd b/tests/aggregate/rule_500_test_input.vhd
deleted file mode 100644
index 1b3d6edc0..000000000
--- a/tests/aggregate/rule_500_test_input.vhd
+++ /dev/null
@@ -1,148 +0,0 @@
-
-architecture rtl of test is
-
-  signal sig : signed := (others => '0');
-
-  function my_func (
-    test : t_counter := (others => '0')
-  ) return integer is
-  begin
-    return (others => '0');
-  end function;
-
-begin
-
-  a <=
-  (
-    1      => '1',
-    others => '0'
-  );
-  a <= (
-         1 => '1',
-         others => '0'
-       ) when condition else
-       (others => '0');
-  with condition select a <=
-    (others => '1') when x,
-    (others => '0') when others;
-
-  process is
-
-    constant con : signed := (others => '0');
-    variable var : signed := (others => '0');
-
-  begin
-
-    a <=
-    (
-      1      => '1',
-      others => '0'
-    );
-    a <= (
-           1 => '1',
-           others => '0'
-         ) when condition else
-         (others => '0');
-    with condition select a <=
-    (others => '1') when x,
-    (others => '0') when others;
-
-    a :=
-    (
-      1 => '1',
-      others => '0'
-    );
-    a := (
-           1 => '1',
-           others => '0'
-         ) when condition else
-         (others => '0');
-    with condition select a :=
-    (others => '1') when x,
-    (others => '0') when others;
-
-    case expression is
-
-      when others =>
-
-        null;
-
-    end case;
-
-  end process;
-
-end architecture rtl;
-
-architecture rtl of test is
-
-  signal sig : signed := (OTHERS => '0');
-
-  function my_func (
-    test : t_counter := (OTHERS => '0')
-  ) return integer is
-  begin
-    return (OTHERS => '0');
-  end function;
-
-begin
-
-  a <=
-  (
-    1      => '1',
-    OTHERS => '0'
-  );
-  a <= (
-         1 => '1',
-         OTHERS => '0'
-       ) when condition else
-       (OTHERS => '0');
-  with condition select a <=
-    (OTHERS => '1') when x,
-    (OTHERS => '0') when others;
-
-  process is
-
-    constant con : signed := (OTHERS => '0');
-    variable var : signed := (OTHERS => '0');
-
-  begin
-
-    a <=
-    (
-      1      => '1',
-      OTHERS => '0'
-    );
-    a <= (
-           1 => '1',
-           OTHERS => '0'
-         ) when condition else
-         (OTHERS => '0');
-    with condition select a <=
-    (OTHERS => '1') when x,
-    (OTHERS => '0') when others;
-
-    a :=
-    (
-      1 => '1',
-      OTHERS => '0'
-    );
-    a := (
-           1 => '1',
-           OTHERS => '0'
-         ) when condition else
-         (OTHERS => '0');
-    with condition select a :=
-    (OTHERS => '1') when x,
-    (OTHERS => '0') when others;
-
-    case expression is
-
-      when others =>
-
-        null;
-
-    end case;
-
-  end process;
-
-end architecture rtl;
diff --git a/tests/aggregate/test_rule_500.py b/tests/aggregate/test_rule_500.py
index 04b61c121..a05b4f2c7 100644
--- a/tests/aggregate/test_rule_500.py
+++ b/tests/aggregate/test_rule_500.py
@@ -1,73 +1,14 @@
 # -*- coding: utf-8 -*-
 
-import os
 import unittest
 
-from tests import utils
-from vsg import vhdlFile
 from vsg.rules import aggregate
 
-sTestDir = os.path.dirname(__file__)
 
-lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_500_test_input.vhd"))
-
-lExpected_lower = []
-lExpected_lower.append("")
-utils.read_file(os.path.join(sTestDir, "rule_500_test_input.fixed_lower.vhd"), lExpected_lower)
-
-lExpected_upper = []
-lExpected_upper.append("")
-utils.read_file(os.path.join(sTestDir, "rule_500_test_input.fixed_upper.vhd"), lExpected_upper)
-
-
-class test_aggregate_rule(unittest.TestCase):
-    def setUp(self):
-        self.oFile = vhdlFile.vhdlFile(lFile)
-        self.assertIsNone(eError)
-
-    def test_rule_500_lower(self):
+class test_rule(unittest.TestCase):
+    def test_rule_500(self):
         oRule = aggregate.rule_500()
         self.assertTrue(oRule)
         self.assertEqual(oRule.name, "aggregate")
         self.assertEqual(oRule.identifier, "500")
-
-        lExpected = [78, 81, 84, 92, 96, 98, 100, 101, 105, 106, 113, 117, 119, 121, 122, 127, 131, 133, 135, 136]
-
-        oRule.analyze(self.oFile)
-        self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
-
-    def test_rule_500_upper(self):
-        oRule = aggregate.rule_500()
-        oRule.case = "upper"
-        self.assertTrue(oRule)
-        self.assertEqual(oRule.name, "aggregate")
-        self.assertEqual(oRule.identifier, "500")
-
-        lExpected = [4, 7, 10, 18, 22, 24, 26, 27, 31, 32, 39, 43, 45, 47, 48, 53, 57, 59, 61, 62]
-        oRule.analyze(self.oFile)
-        self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
-
-    def test_fix_rule_500_lower(self):
-        oRule = aggregate.rule_500()
-
-        oRule.fix(self.oFile)
-
-        lActual = self.oFile.get_lines()
-
-        self.assertEqual(lExpected_lower, lActual)
-
-        oRule.analyze(self.oFile)
-        self.assertEqual(oRule.violations, [])
-
-    def test_fix_rule_500_upper(self):
-        oRule = aggregate.rule_500()
-        oRule.case = "upper"
-
-        oRule.fix(self.oFile)
-
-        lActual = self.oFile.get_lines()
-
-        self.assertEqual(lExpected_upper, lActual)
-
-        oRule.analyze(self.oFile)
-        self.assertEqual(oRule.violations, [])
+        self.assertTrue(oRule.deprecated)
diff --git a/tests/bit_string_literal/test_rule_500.py b/tests/bit_string_literal/test_rule_500.py
index b7786ef87..628eec5a6 100644
--- a/tests/bit_string_literal/test_rule_500.py
+++ b/tests/bit_string_literal/test_rule_500.py
@@ -20,7 +20,7 @@
 utils.read_file(os.path.join(sTestDir, "rule_500_test_input.fixed_upper.vhd"), lExpected_upper)
 
 
-class test_assert_rule(unittest.TestCase):
+class test_bit_string_literal_rule(unittest.TestCase):
     def setUp(self):
         self.oFile = vhdlFile.vhdlFile(lFile)
         self.assertIsNone(eError)
diff --git a/tests/bit_string_literal/test_rule_501.py b/tests/bit_string_literal/test_rule_501.py
index ffc13b421..662da8417 100644
--- a/tests/bit_string_literal/test_rule_501.py
+++ b/tests/bit_string_literal/test_rule_501.py
@@ -20,7 +20,7 @@
 utils.read_file(os.path.join(sTestDir, "rule_501_test_input.fixed_upper.vhd"), lExpected_upper)
 
 
-class test_assert_rule(unittest.TestCase):
+class test_bit_string_literal_rule(unittest.TestCase):
     def setUp(self):
         self.oFile = vhdlFile.vhdlFile(lFile)
         self.assertIsNone(eError)
diff --git a/tests/case/rule_500_test_input.fixed_lower.vhd b/tests/case/rule_500_test_input.fixed_lower.vhd
deleted file mode 100644
index 5d53a079c..000000000
--- a/tests/case/rule_500_test_input.fixed_lower.vhd
+++ /dev/null
@@ -1,19 +0,0 @@
-
-architecture rtl of fifo is
-
-begin
-
-  process
-  begin
-    case expression is
-      when others =>
-
-    end case;
-
-    case expression is
-      when others =>
-
-    end case;
-  end process;
-
-end architecture;
diff --git a/tests/case/rule_500_test_input.fixed_upper.vhd b/tests/case/rule_500_test_input.fixed_upper.vhd
deleted file mode 100644
index 04720edb8..000000000
--- a/tests/case/rule_500_test_input.fixed_upper.vhd
+++ /dev/null
@@ -1,19 +0,0 @@
-
-architecture rtl of fifo is
-
-begin
-
-  process
-  begin
-    case expression is
-      when OTHERS =>
-
-    end case;
-
-    case expression is
-      when OTHERS =>
-
-    end case;
-  end process;
-
-end architecture;
diff --git a/tests/case/rule_500_test_input.vhd b/tests/case/rule_500_test_input.vhd
deleted file mode 100644
index f9839534d..000000000
--- a/tests/case/rule_500_test_input.vhd
+++ /dev/null
@@ -1,19 +0,0 @@
-
-architecture rtl of fifo is
-
-begin
-
-  process
-  begin
-    case expression is
-      when others =>
-
-    end case;
-
-    case expression is
-      when OTHERS =>
-
-    end case;
-  end process;
-
-end architecture;
diff --git a/tests/case/test_rule_500.py b/tests/case/test_rule_500.py
index 8b9e5f338..864111a76 100644
--- a/tests/case/test_rule_500.py
+++ b/tests/case/test_rule_500.py
@@ -1,70 +1,14 @@
 # -*- coding: utf-8 -*-
 
-import os
 import unittest
 
-from tests import utils
-from vsg import vhdlFile
 from vsg.rules import case
 
-sTestDir = os.path.dirname(__file__)
 
-lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_500_test_input.vhd"))
-
-lExpected_lower = []
-lExpected_lower.append("")
-utils.read_file(os.path.join(sTestDir, "rule_500_test_input.fixed_lower.vhd"), lExpected_lower)
-
-lExpected_upper = []
-lExpected_upper.append("")
-utils.read_file(os.path.join(sTestDir, "rule_500_test_input.fixed_upper.vhd"), lExpected_upper)
-
-
-class test_case_rule(unittest.TestCase):
-    def setUp(self):
-        self.oFile = vhdlFile.vhdlFile(lFile)
-        self.assertIsNone(eError)
-
-    def test_rule_500_lower(self):
+class test_rule(unittest.TestCase):
+    def test_rule_500(self):
         oRule = case.rule_500()
         self.assertTrue(oRule)
         self.assertEqual(oRule.name, "case")
         self.assertEqual(oRule.identifier, "500")
-
-        lExpected = [14]
-
-        oRule.analyze(self.oFile)
-        self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
-
-    def test_rule_500_upper(self):
-        oRule = case.rule_500()
-        oRule.case = "upper"
-
-        lExpected = [9]
-        oRule.analyze(self.oFile)
-        self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
-
-    def test_fix_rule_500_lower(self):
-        oRule = case.rule_500()
-
-        oRule.fix(self.oFile)
-
-        lActual = self.oFile.get_lines()
-
-        self.assertEqual(lExpected_lower, lActual)
-
-        oRule.analyze(self.oFile)
-        self.assertEqual(oRule.violations, [])
-
-    def test_fix_rule_500_upper(self):
-        oRule = case.rule_500()
-        oRule.case = "upper"
-
-        oRule.fix(self.oFile)
-
-        lActual = self.oFile.get_lines()
-
-        self.assertEqual(lExpected_upper, lActual)
-
-        oRule.analyze(self.oFile)
-        self.assertEqual(oRule.violations, [])
+        self.assertTrue(oRule.deprecated)
diff --git a/tests/case_generate_alternative/rule_501_test_input.fixed_lower.vhd b/tests/case_generate_alternative/rule_501_test_input.fixed_lower.vhd
deleted file mode 100644
index fea09f76e..000000000
--- a/tests/case_generate_alternative/rule_501_test_input.fixed_lower.vhd
+++ /dev/null
@@ -1,16 +0,0 @@
-
-architecture rtl of fifo is
-
-begin
-
-  GEN_LABEL : case expression generate
-    when others =>
-
-  end generate;
-
-  GEN_LABEL : case expression generate
-    when others =>
-
-  end generate;
-
-end architecture;
diff --git a/tests/case_generate_alternative/rule_501_test_input.fixed_upper.vhd b/tests/case_generate_alternative/rule_501_test_input.fixed_upper.vhd
deleted file mode 100644
index 9eb313b13..000000000
--- a/tests/case_generate_alternative/rule_501_test_input.fixed_upper.vhd
+++ /dev/null
@@ -1,16 +0,0 @@
-
-architecture rtl of fifo is
-
-begin
-
-  GEN_LABEL : case expression generate
-    when OTHERS =>
-
-  end generate;
-
-  GEN_LABEL : case expression generate
-    when OTHERS =>
-
-  end generate;
-
-end architecture;
diff --git a/tests/case_generate_alternative/rule_501_test_input.vhd b/tests/case_generate_alternative/rule_501_test_input.vhd
deleted file mode 100644
index fedf2d072..000000000
--- a/tests/case_generate_alternative/rule_501_test_input.vhd
+++ /dev/null
@@ -1,16 +0,0 @@
-
-architecture rtl of fifo is
-
-begin
-
-  GEN_LABEL : case expression generate
-    when others =>
-
-  end generate;
-
-  GEN_LABEL : case expression generate
-    when OTHERS =>
-
-  end generate;
-
-end architecture;
diff --git a/tests/case_generate_alternative/test_rule_501.py b/tests/case_generate_alternative/test_rule_501.py
index 8148a49bb..1f2bb26d3 100644
--- a/tests/case_generate_alternative/test_rule_501.py
+++ b/tests/case_generate_alternative/test_rule_501.py
@@ -1,70 +1,14 @@
 # -*- coding: utf-8 -*-
 
-import os
 import unittest
 
-from tests import utils
-from vsg import vhdlFile
 from vsg.rules import case_generate_alternative
 
-sTestDir = os.path.dirname(__file__)
 
-lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_501_test_input.vhd"))
-
-lExpected_lower = []
-lExpected_lower.append("")
-utils.read_file(os.path.join(sTestDir, "rule_501_test_input.fixed_lower.vhd"), lExpected_lower)
-
-lExpected_upper = []
-lExpected_upper.append("")
-utils.read_file(os.path.join(sTestDir, "rule_501_test_input.fixed_upper.vhd"), lExpected_upper)
-
-
-class test_case_generate_alternative_rule(unittest.TestCase):
-    def setUp(self):
-        self.oFile = vhdlFile.vhdlFile(lFile)
-        self.assertIsNone(eError)
-
-    def test_rule_501_lower(self):
+class test_rule(unittest.TestCase):
+    def test_rule_501(self):
         oRule = case_generate_alternative.rule_501()
         self.assertTrue(oRule)
         self.assertEqual(oRule.name, "case_generate_alternative")
         self.assertEqual(oRule.identifier, "501")
-
-        lExpected = [12]
-
-        oRule.analyze(self.oFile)
-        self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
-
-    def test_rule_501_upper(self):
-        oRule = case_generate_alternative.rule_501()
-        oRule.case = "upper"
-
-        lExpected = [7]
-        oRule.analyze(self.oFile)
-        self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
-
-    def test_fix_rule_501_lower(self):
-        oRule = case_generate_alternative.rule_501()
-
-        oRule.fix(self.oFile)
-
-        lActual = self.oFile.get_lines()
-
-        self.assertEqual(lExpected_lower, lActual)
-
-        oRule.analyze(self.oFile)
-        self.assertEqual(oRule.violations, [])
-
-    def test_fix_rule_501_upper(self):
-        oRule = case_generate_alternative.rule_501()
-        oRule.case = "upper"
-
-        oRule.fix(self.oFile)
-
-        lActual = self.oFile.get_lines()
-
-        self.assertEqual(lExpected_upper, lActual)
-
-        oRule.analyze(self.oFile)
-        self.assertEqual(oRule.violations, [])
+        self.assertTrue(oRule.deprecated)
diff --git a/tests/choice/__init__.py b/tests/choice/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/choice/rule_500_test_input.fixed_lower.vhd b/tests/choice/rule_500_test_input.fixed_lower.vhd
new file mode 100644
index 000000000..1d490485c
--- /dev/null
+++ b/tests/choice/rule_500_test_input.fixed_lower.vhd
@@ -0,0 +1,70 @@
+
+architecture RTL of FIFO is
+
+begin
+
+  -- Lower
+
+  with a select b <=
+    c when others;
+
+  a <= (others => (others => (others => '0')));
+
+  process (all) is
+  begin
+
+    with a select b <=
+      c when others;
+
+    a <= (others => (others => (others => '0')));
+
+    with a select b :=
+      c when others;
+
+    a := (others => (others => (others => '0')));
+
+    case a is
+      when others =>
+        null;
+    end case;
+
+  end process;
+
+  case_gen : case a generate
+    when others =>
+      a <= b;
+  end generate;
+
+  -- Upper
+
+  with a select b <=
+    c when others;
+
+  a <= (others => (others => (others => '0')));
+
+  process (all) is
+  begin
+
+    with a select b <=
+      c when others;
+
+    a <= (others => (others => (others => '0')));
+
+    with a select b :=
+      c when others;
+
+    a := (others => (others => (others => '0')));
+
+    case a is
+      when others =>
+        null;
+    end case;
+
+  end process;
+
+  case_gen : case a generate
+    when others =>
+      a <= b;
+  end generate;
+
+end architecture RTL;
diff --git a/tests/choice/rule_500_test_input.fixed_upper.vhd b/tests/choice/rule_500_test_input.fixed_upper.vhd
new file mode 100644
index 000000000..9f72bce61
--- /dev/null
+++ b/tests/choice/rule_500_test_input.fixed_upper.vhd
@@ -0,0 +1,70 @@
+
+architecture RTL of FIFO is
+
+begin
+
+  -- Lower
+
+  with a select b <=
+    c when OTHERS;
+
+  a <= (OTHERS => (OTHERS => (OTHERS => '0')));
+
+  process (all) is
+  begin
+
+    with a select b <=
+      c when OTHERS;
+
+    a <= (OTHERS => (OTHERS => (OTHERS => '0')));
+
+    with a select b :=
+      c when OTHERS;
+
+    a := (OTHERS => (OTHERS => (OTHERS => '0')));
+
+    case a is
+      when OTHERS =>
+        null;
+    end case;
+
+  end process;
+
+  case_gen : case a generate
+    when OTHERS =>
+      a <= b;
+  end generate;
+
+  -- Upper
+
+  with a select b <=
+    c when OTHERS;
+
+  a <= (OTHERS => (OTHERS => (OTHERS => '0')));
+
+  process (all) is
+  begin
+
+    with a select b <=
+      c when OTHERS;
+
+    a <= (OTHERS => (OTHERS => (OTHERS => '0')));
+
+    with a select b :=
+      c when OTHERS;
+
+    a := (OTHERS => (OTHERS => (OTHERS => '0')));
+
+    case a is
+      when OTHERS =>
+        null;
+    end case;
+
+  end process;
+
+  case_gen : case a generate
+    when OTHERS =>
+      a <= b;
+  end generate;
+
+end architecture RTL;
diff --git a/tests/choice/rule_500_test_input.vhd b/tests/choice/rule_500_test_input.vhd
new file mode 100644
index 000000000..1246ccb64
--- /dev/null
+++ b/tests/choice/rule_500_test_input.vhd
@@ -0,0 +1,70 @@
+
+architecture RTL of FIFO is
+
+begin
+
+  -- Lower
+
+  with a select b <=
+    c when others;
+
+  a <= (others => (others => (others => '0')));
+
+  process (all) is
+  begin
+
+    with a select b <=
+      c when others;
+
+    a <= (others => (others => (others => '0')));
+
+    with a select b :=
+      c when others;
+
+    a := (others => (others => (others => '0')));
+
+    case a is
+      when others =>
+        null;
+    end case;
+
+  end process;
+
+  case_gen : case a generate
+    when others =>
+      a <= b;
+  end generate;
+
+  -- Upper
+
+  with a select b <=
+    c when OTHERS;
+
+  a <= (OTHERS => (OTHERS => (OTHERS => '0')));
+
+  process (all) is
+  begin
+
+    with a select b <=
+      c when OTHERS;
+
+    a <= (OTHERS => (OTHERS => (OTHERS => '0')));
+
+    with a select b :=
+      c when OTHERS;
+
+    a := (OTHERS => (OTHERS => (OTHERS => '0')));
+
+    case a is
+      when OTHERS =>
+        null;
+    end case;
+
+  end process;
+
+  case_gen : case a generate
+    when OTHERS =>
+      a <= b;
+  end generate;
+
+end architecture RTL;
diff --git a/tests/choice/test_rule_500.py b/tests/choice/test_rule_500.py
new file mode 100644
index 000000000..e0ed51acd
--- /dev/null
+++ b/tests/choice/test_rule_500.py
@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+
+import os
+import unittest
+
+from tests import utils
+from vsg import vhdlFile
+from vsg.rules import choice
+
+sTestDir = os.path.dirname(__file__)
+
+lFile, eError = vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir, "rule_500_test_input.vhd"))
+
+lExpected_lower = []
+lExpected_lower.append("")
+utils.read_file(os.path.join(sTestDir, "rule_500_test_input.fixed_lower.vhd"), lExpected_lower)
+
+lExpected_upper = []
+lExpected_upper.append("")
+utils.read_file(os.path.join(sTestDir, "rule_500_test_input.fixed_upper.vhd"), lExpected_upper)
+
+
+class test_choice_rule(unittest.TestCase):
+    def setUp(self):
+        self.oFile = vhdlFile.vhdlFile(lFile)
+        self.assertIsNone(eError)
+
+    def test_rule_500_lower(self):
+        oRule = choice.rule_500()
+        self.assertTrue(oRule)
+        self.assertEqual(oRule.name, "choice")
+        self.assertEqual(oRule.identifier, "500")
+
+        lExpected = [41, 43, 43, 43, 49, 51, 51, 51, 54, 56, 56, 56, 59, 66]
+
+        oRule.analyze(self.oFile)
+        self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
+
+    def test_rule_500_upper(self):
+        oRule = choice.rule_500()
+        oRule.case = "upper"
+        self.assertTrue(oRule)
+        self.assertEqual(oRule.name, "choice")
+        self.assertEqual(oRule.identifier, "500")
+
+        lExpected = [9, 11, 11, 11, 17, 19, 19, 19, 22, 24, 24, 24, 27, 34]
+
+        oRule.analyze(self.oFile)
+        self.assertEqual(utils.extract_violation_lines_from_violation_object(oRule.violations), lExpected)
+
+    def test_fix_rule_500_lower(self):
+        oRule = choice.rule_500()
+
+        oRule.fix(self.oFile)
+
+        lActual = self.oFile.get_lines()
+
+        self.assertEqual(lExpected_lower, lActual)
+
+        oRule.analyze(self.oFile)
+        self.assertEqual(oRule.violations, [])
+
+    def test_fix_rule_500_upper(self):
+        oRule = choice.rule_500()
+        oRule.case = "upper"
+
+        oRule.fix(self.oFile)
+
+        lActual = self.oFile.get_lines()
+
+        self.assertEqual(lExpected_upper, lActual)
+
+        oRule.analyze(self.oFile)
+        self.assertEqual(oRule.violations, [])