jeremiah-c-leary / vhdl-style-guide

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

Support vsg as pre-commit hook #1011

Closed alonbl closed 10 months ago

alonbl commented 11 months ago

Description

pre-commit is a tool for running various of format and validation tools. It would be nice if it will be possible to use vsg as pre-commit hook.

Additional context

Trivial changes provided as a patch set:

Tested and working for me, please let me know what you think.

codecov[bot] commented 11 months ago

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (941a661) 96.03% compared to head (20378c3) 96.03%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1011 +/- ## ========================================== - Coverage 96.03% 96.03% -0.01% ========================================== Files 1512 1512 Lines 28575 28577 +2 ========================================== + Hits 27442 27443 +1 - Misses 1133 1134 +1 ``` | [Files](https://app.codecov.io/gh/jeremiah-c-leary/vhdl-style-guide/pull/1011?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeremiah+Leary) | Coverage Δ | | |---|---|---| | [vsg/cmd\_line\_args.py](https://app.codecov.io/gh/jeremiah-c-leary/vhdl-style-guide/pull/1011?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeremiah+Leary#diff-dnNnL2NtZF9saW5lX2FyZ3MucHk=) | `93.68% <100.00%> (+0.06%)` | :arrow_up: | | [vsg/version.py](https://app.codecov.io/gh/jeremiah-c-leary/vhdl-style-guide/pull/1011?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jeremiah+Leary#diff-dnNnL3ZlcnNpb24ucHk=) | `20.00% <0.00%> (-0.41%)` | :arrow_down: |

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

jeremiah-c-leary commented 10 months ago

Morning @alonbl ,

I feel the documentation for pre-commit should be moved from the usage page to it's own page. I worry people could miss this integration opportunity. I can't decide exactly where it would go.

So at the top level there are the following sections:

So something like this:

Then we could go into more detail on how to properly integrate VSG with pre-commit and better communicates the integration option.

What do you think?

--Jeremy

alonbl commented 10 months ago

OK, moved documentation to own page, in most cases people who use pre-commit understand how to use the plugins, I do not think we should be so verbose.

jeremiah-c-leary commented 10 months ago

Morning @alonbl ,

Looks good.

--Jeremy

alonbl commented 10 months ago

Hi @jeremiah-c-leary, I added another example for the pre-commit configuration. Alon

alonbl commented 10 months ago

Closed via #1017