jeremiah-c-leary / vhdl-style-guide

Style guide enforcement for VHDL
GNU General Public License v3.0
187 stars 38 forks source link

Fix bug in whitespace between tokens and add test for it #1183

Closed edgarmv closed 3 months ago

edgarmv commented 3 months ago

Description Fixes two bugs in whitespace_between_tokens.py. The first bug is passing the number of spaces as index into lTokens instead of the num parameter. This fails when number_of_spaces is more than 1, and is silently catched by an except IndexError.

The second bug is fixed by adding extraction of number_of_spaces if the number ends with a +. There already is a function for analyzing if it exists, but the functionality of extracting it is missing.

Also add a test in element_association that checks that you can set number_of_spaces: '2+', covering both these bugs.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.03%. Comparing base (baf22da) to head (af9cdb2). Report is 22 commits behind head on master.

Files Patch % Lines
vsg/rules/whitespace_between_tokens.py 66.66% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1183 +/- ## ========================================== + Coverage 94.01% 94.03% +0.01% ========================================== Files 1557 1559 +2 Lines 29028 29170 +142 Branches 3414 3441 +27 ========================================== + Hits 27291 27429 +138 - Misses 1303 1305 +2 - Partials 434 436 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jeremiah-c-leary commented 3 months ago

Evening @edgarmv ,

Thank you very much for finding these issues. I also appreciate that you added a test to catch the error along with the bug fix.

I will merge this to master.

Regards,

--Jeremy