Skip to content

if_009 with smart tabs indentation wrong output #1218

@magborresen

Description

@magborresen

Environment
VSG Version 3.23.0
Environment VSCode 1.92.2 on Windows 10

Describe the bug
When using the if_009 rule to align if statements that have multi-line boolean expressions while using smart_tabs with 4 spaces for indentation, the output is incorrect. It does not matter how the conditions of if_009 is set.

To Reproduce
if_009: align_left: 'yes' align_paren: 'no'

Expected behavior
Expected Output:
` when state_lo_active =>

				if pwm = '0' or force_lo_pulse = '1' then
					oc_lock <= '0';
				end if;

				if hi_locked = '1' or oc_lock = '1' or do_ls_on_fast = '1' then
					state_locked <= '1';
				else
					state_locked <= '0';
				end if;

				if over_current_lo_fast = '1' then
					state    <= state_dt_init_hi;
					hi_start <= '1';
					oc_lock  <= '1';
				elsif over_current_hi_fast = '0' and lo_mpw_end = '1' and state_locked = '0' and
                                        (pwm = '1' or force_hi_pulse = '1') then
					state    <= state_dt_init_hi;
					hi_start <= '1';
					oc_lock  <= '0';
				end if;`

Actual Output:
` when state_lo_active =>

				if pwm = '0' or force_lo_pulse = '1' then
					oc_lock <= '0';
				end if;

				if hi_locked = '1' or oc_lock = '1' or do_ls_on_fast = '1' then
					state_locked <= '1';
				else
					state_locked <= '0';
				end if;

				if over_current_lo_fast = '1' then
					state    <= state_dt_init_hi;
					hi_start <= '1';
					oc_lock  <= '1';
				elsif over_current_hi_fast = '0' and lo_mpw_end = '1' and state_locked = '0' and
  (pwm = '1' or force_hi_pulse = '1') then
					state    <= state_dt_init_hi;
					hi_start <= '1';
					oc_lock  <= '0';
				end if;`

Screenshots
Capture

Additional context
I have not tested if this happens if the if statement is not already indented.

Metadata

Metadata

Labels

Projects

Status

User Validation

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions