Case Rules

case_001

phase_4 error indent

This rule checks the indent of case, when, and end case keywords.

Violation

 case data is

     when 0 =>
 when 1 =>
         when 3 =>

end case;

Fix

case data is

  when 0 =>
  when 1 =>
  when 3 =>

end case;

case_002

phase_2 error whitespace

This rule checks for a single space after the case keyword.

Refer to Configuring Whitespace Rules for options on changing the number of whitespaces..

Violation

case    data is

Fix

case data is

case_003

phase_2 error whitespace

This rule checks for a single space before the is keyword.

Refer to Configuring Whitespace Rules for options on changing the number of whitespaces..

Violation

case data    is

Fix

case data is

case_004

phase_2 error whitespace

This rule checks for a single space after the when keyword.

Refer to Configuring Whitespace Rules for options on changing the number of whitespaces..

Violation

case data is

  when   3 =>

Fix

case data is

  when 3 =>

case_005

phase_2 error whitespace

This rule checks for a single space before the => operator.

Refer to Configuring Whitespace Rules for options on changing the number of whitespaces..

Violation

case data is

  when 3   =>

Fix

case data is

  when 3 =>

case_006

phase_2 error whitespace

This rule checks for a single space between the end and case keywords.

Refer to Configuring Whitespace Rules for options on changing the number of whitespaces..

Violation

case data is

end    case;

Fix

case data is

end case;

case_007

phase_3 error blank_line

This rule checks for blank lines or comments above the case keyword.

Refer to Configuring Previous Line Rules for more information.

The default style is no_code.

Violation

a <= '1';
case data is


-- This is a comment
case data is

Fix

a <= '1';

case data is


-- This is a comment
case data is

case_008

The function of this rule has been included in rule case_201.

case_009

phase_3 error blank_line

This rule checks for blank lines or comments above the end keyword.

Refer to Configuring Blank Lines for more information.

Violation

  when others =>
    null;
end case;

Fix

  when others =>
    null;

end case;

case_010

phase_3 error blank_line

This rule checks for a blank line below the end case keywords.

Refer to Configuring Blank Lines for more information.

Violation

end case;
a <= '1';

Fix

end case;

a <= '1';

case_011

phase_4 error alignment

This rule checks the alignment of multiline when statements.

Violation

case data is

  when 0 | 1 | 2 | 3
   4 | 5 | 7 =>

Fix

case data is

  when 0 | 1 | 2 | 3
       4 | 5 | 7 =>

case_012

phase_1 error structure

This rule checks for code after the => operator.

Violation

when 0 => a <= '1';

Fix

when 0 =>
  a <= '1';

case_013

phase_4 error indent

This rule checks the indent of the null keyword.

Violation

  when others =>
     null;

  when others =>
null;

Fix

when others =>
  null;

when others =>
  null;

case_014

phase_6 error case case_keyword

This rule checks the case keyword has proper case.

Refer to Configuring Uppercase and Lowercase Rules for more information.

Violation

CASE address is

Case address is

case address is

Fix

case address is

case address is

case address is

case_015

phase_6 error case case_keyword

This rule checks the is keyword has proper case.

Refer to Configuring Uppercase and Lowercase Rules for more information.

Violation

case address IS

case address Is

case address iS

Fix

case address is

case address is

case address is

case_016

phase_6 error case case_keyword

This rule checks the when has proper case.

Refer to Configuring Uppercase and Lowercase Rules for more information.

Violation

WHEN a =>
When b =>
when c =>

Fix

when a =>
when b =>
when c =>

case_017

phase_6 error case case_keyword

This rule checks the end keyword in the end case has proper case.

Refer to Configuring Uppercase and Lowercase Rules for more information.

Violation

End case;
END case;
end case;

Fix

end case;
end case;
end case;

case_018

phase_6 error case case_keyword

This rule checks the case keyword has proper case in the end case.

Refer to Configuring Uppercase and Lowercase Rules for more information.

Violation

end CASE;
end CAse;
end case;

Fix

end case;
end case;
end case;

case_019

phase_1 error structure

This rule checks for labels before the case keyword. The label should be removed. The preference is to have comments above the case statement.

Violation

CASE_LABEL : case address is
CASE_LABEL: case address is
case address is

Fix

case address is
case address is
case address is

case_020

phase_1 error structure

This rule checks for labels after the end case keywords. The label should be removed. The preference is to have comments above the case statement.

Violation

end case CASE_LABEL;
end case;

Fix

end case;
end case;

case_021

The function of this rule has been superseded with comment indent updates and is handled by rule comment_010.

case_200

phase_3 error blank_line

This rule checks for a blank line below the => keyword.

Refer to Configuring Blank Lines for more information.

Violation

when 0 =>
  a <= b;

Fix

when 0 =>

  a <= b;

case_201

phase_3 error blank_line

This rule checks for blank lines or comments above the when keyword.

Refer to Configuring Previous Line Rules for more information.

The default style is allow_comment.

Violation

case data is
  when 3 =>
  -- Comment
  when 4 =>

Fix

case data is

  when 3 =>

  -- Comment
  when 4 =>