-
-
Notifications
You must be signed in to change notification settings - Fork 301
Self Check With New commitizen-branch
pre-commit Hook
#565
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
Conversation
Codecov ReportBase: 98.43% // Head: 98.37% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@ ## master #565 +/- ## ========================================== - Coverage 98.43% 98.37% -0.07% ========================================== Files 39 39 Lines 1602 1602 ========================================== - Hits 1577 1576 -1 - Misses 25 26 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
They already run pre-push, and this behavior is left unchanged. Running hooks pre-commit gives developers more immediate feedback and improves commit quality by blocking an often unnecessary series of fix commits.
Use new commitizen-branch hook to verify correctness of existing commit messages post-commit and pre-push. This guards against cherry-picked commits with invalid commit messages as well as empty commit messages (e.g., created with git commit --allow-empty-message).
7ce29d3
to
f65da26
Compare
The Codecov issue strikes me as test flakiness.
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.
LGTM. Thanks @Kurt-von-Laven Let's merge it
Uh oh!
There was an error while loading. Please reload this page.
Description
Check existing commit messages. Use new
commitizen-branch
hook to verify correctness of existing commit messages post-commit and pre-push. This guards against cherry-picked commits with invalid commit messages as well as empty commit messages (e.g., created withgit commit --allow-empty-message
).Run hooks pre-commit by default. They already run pre-push, and this behavior is left unchanged. Running hooks pre-commit gives developers more immediate feedback and improves commit quality by blocking an often unnecessary series of fix commits.
When testing this change locally,
poetry install
failed with the following error:I think
poetry update
may need to be run, but when I tried that, I encountered 51 test failures.Checklist
./scripts/format
and./scripts/test
locally to ensure this change passes linter check and testExpected behavior
The new
commitizen-branch
hook passes.Steps to Test This Pull Request
poetry update
to work around issue described above.poetry install
to install pre-commit and other dependencies.commitizen-branch
hook fails when the rangeorigin/HEAD..HEAD
contains no commits.poetry run pre-commit run --all-files --hook-stage push
to run all pre-push hooks.Additional context
Follows on #517.