Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if_009 with smart tabs indentation wrong output #1218

Open
magborresen opened this issue Aug 26, 2024 · 2 comments · May be fixed by #1401
Open

if_009 with smart tabs indentation wrong output #1218

magborresen opened this issue Aug 26, 2024 · 2 comments · May be fixed by #1401
Assignees
Labels

Comments

@magborresen
Copy link

magborresen commented Aug 26, 2024

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.

@jeremiah-c-leary
Copy link
Owner

Evening @magborresen ,

I was able to duplicate the issue and will be moving this issue into the triaged state.

Regards,

--Jeremy

@jeremiah-c-leary jeremiah-c-leary moved this from Triaged to In Progress in vhdl-style-guide Jan 4, 2025
@jeremiah-c-leary jeremiah-c-leary moved this from In Progress to Triaged in vhdl-style-guide Jan 12, 2025
@jeremiah-c-leary jeremiah-c-leary moved this from Triaged to In Progress in vhdl-style-guide Jan 13, 2025
@jeremiah-c-leary jeremiah-c-leary self-assigned this Jan 18, 2025
@jeremiah-c-leary jeremiah-c-leary linked a pull request Jan 25, 2025 that will close this issue
@jeremiah-c-leary
Copy link
Owner

Morning @magborresen ,

It took me a while, but I believe I have a fix for this issue. Could you check out branch issue-1218 and let me know if it resolves the issue for you?

Thanks,

--Jeremy

@jeremiah-c-leary jeremiah-c-leary moved this from In Progress to User Validation in vhdl-style-guide Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: User Validation
Development

Successfully merging a pull request may close this issue.

3 participants
@jeremiah-c-leary @magborresen and others