feat: add custom validation#1236
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v4-11-0 #1236 +/- ##
==========================================
Coverage ? 98.64%
==========================================
Files ? 60
Lines ? 2664
Branches ? 0
==========================================
Hits ? 2628
Misses ? 36
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fbf3813 to
7bd16c3
Compare
|
@Lee-W I was wondering if you had any input to this PR? |
|
I'll be mostly out till at least mid-Oct, will try to check in depth after that. Thanks! |
Lee-W
left a comment
There was a problem hiding this comment.
Overall, I love this idea! left a few improvement suggestions
|
I'll be mostly out for the following month. Will try to take a look when I'm back. |
Lee-W
left a comment
There was a problem hiding this comment.
Sorry for taking so long. Some nitpicks. but we're close to merge I think!
|
Hey @benediktziegler , I left a few nits, but overall this PR is great! We're super close to merging. |
|
Hey @benediktziegler , I think we're almost good to merge this one. But could you please help us rebase from the branch |
|
@Lee-W I agree the merging was a bit messy and seems to even contain unwanted changes in the end. I propose I force push the squashed changes from this branch into this PR: https://github.com/benediktziegler/commitizen/tree/feature/custom-validation-clean instead. Or we merge this one instead: #1680 |
|
either way works perfect :) I'll take one final look at the other draft PR, if your force push didn't beat me haha |
50405b0 to
265cb98
Compare
|
Both are the same now, so I drop the draft PR. Potential conflict with #1657. |
|
Super! Thanks so much! |
Description
This PR adds functionality to customise the commit message validation and to format the
InvalidCommitMessageErrorto give better/more detailed feedback to the user.Checklist
./scripts/formatand./scripts/testlocally to ensure this change passes linter check and testExpected behavior
The developer of a custom commitizen class can override the
validate_commit_messageandformat_error_messagemethods to perform more complex commit message format checks then just a regex match and give more detailed feedback on failure.Steps to Test This Pull Request
Run the the
test_check_command_with_custom_validator_succeedandtest_check_command_with_custom_validator_failtests intest_check_command.py.Additional context
This PR implements and fixes the comments from #648.