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
ci(pre-commit): add gitlint #1573
Conversation
BreadGenie
commented
Feb 9, 2022
- fix ci: Enforce conventional commit message format in commits #1563
Running of gitlint in CI is not via pre-commit (due to the hook type being commit-msg). I've used a workaround to get it working in our CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git log -1 --pretty=%B | gitlint`
This will only check the last commit, right? What if someone pushes more at once? We need to run on the range of commits in PR.
I feel like the effort/usefulness ratio of properly setting up a CI for this is not great. Every new contrib is gonna trigger this check :)
fc4e5f5
to
e4d66a6
Compare
Codecov Report
@@ Coverage Diff @@
## main #1573 +/- ##
==========================================
- Coverage 80.36% 80.31% -0.05%
==========================================
Files 281 281
Lines 5581 5588 +7
Branches 913 916 +3
==========================================
+ Hits 4485 4488 +3
- Misses 897 899 +2
- Partials 199 201 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
The command for gitlint seems to be not working in our CI. gitlint is using |
The same code works on my fork (failing conventional commit check and passing check) but not here 🤔. Weird. |
@BreadGenie, what you did doesn't work because this repo doesn't have the new branch so you can't just do So what you need to do is checkout more commits (can just leave 0 to checkout all history but maybe 50/100 would be enough) and use exact commits for the range. Look at the last commit here #1578 |
Thanks a lot for the explanation. Good to know that I was closer to what we intended to do. :D |
Is this working as expected and ready to merge? I can't quite tell from the comments what state we're in. |
The commit message test for 3e9b00d failed. So it is working as intended. |
Co-authored-by: Dmitry Volodin <mr.molkree@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, let's give this a shot then! Thanks for all the investigation @BreadGenie and @Molkree
Co-authored-by: Dmitry Volodin <mr.molkree@gmail.com> Co-authored-by: Dmitry Volodin <mr.molkree@gmail.com>