Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add custom validation#1236

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@benediktziegler
Copy link

Description

This PR adds functionality to customise the commit message validation and to format theInvalidCommitMessageError to give better/more detailed feedback to the user.

Checklist

  • Add test cases to all the changes you introduce
  • Run./scripts/format and./scripts/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

The developer of a custom commitizen class can override thevalidate_commit_message andformat_error_message methods 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 thetest_check_command_with_custom_validator_succeed andtest_check_command_with_custom_validator_fail tests intest_check_command.py.

Additional context

This PR implements and fixes the comments from#648.

noirbizarre and Lee-W reacted with heart emoji
@codecov
Copy link

codecovbot commentedSep 13, 2024
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Pleaseupload report for BASE (v4-11-0@1d0f6cb).Learn more about missing BASE report.

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
FlagCoverage Δ
unittests98.64% <100.00%> (?)

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@benediktziegler
Copy link
Author

@Lee-W I was wondering if you had any input to this PR?

@Lee-W
Copy link
Member

I'll be mostly out till at least mid-Oct, will try to check in depth after that. Thanks!

benediktziegler reacted with thumbs up emoji

Copy link
Member

@Lee-WLee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Overall, I love this idea! left a few improvement suggestions

benediktziegler reacted with thumbs up emoji
@Lee-W
Copy link
Member

I'll be mostly out for the following month. Will try to take a look when I'm back.

benediktziegler reacted with thumbs up emoji

Copy link
Member

@Lee-WLee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Sorry for taking so long. Some nitpicks. but we're close to merge I think!

@Lee-WLee-W added type: featureA new enhacement proposal and removed pr-status: wait-for-review labelsJan 30, 2025
@Lee-WLee-W added this to the4.10.0 milestoneSep 9, 2025
@Lee-WLee-W changed the base branch frommaster tov4-11-0November 19, 2025 03:20
@Lee-W
Copy link
Member

Hey@benediktziegler , I left a few nits, but overall this PR is great! We're super close to merging.
We'll include it in 4.11. Hopefully to release some time early Dec

benediktziegler reacted with heart emoji

@Lee-W
Copy link
Member

Hey@benediktziegler , I think we're almost good to merge this one. But could you please help us rebase from the branchv4-11-0? I tried a bit, but I'm worried I might mess it up.

@benediktziegler
Copy link
Author

benediktziegler commentedDec 1, 2025
edited
Loading

@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.
Do you have any objections?

Or we merge this one instead:#1680

@benediktzieglerbenediktziegler mentioned this pull requestDec 1, 2025
4 tasks
@Lee-W
Copy link
Member

either way works perfect :) I'll take one final look at the other draft PR, if your force push didn't beat me haha

@benediktziegler
Copy link
Author

benediktziegler commentedDec 2, 2025
edited
Loading

Both are the same now, so I drop the draft PR.

Potential conflict with#1657.

@Lee-WLee-W merged commitd7ceab8 intocommitizen-tools:v4-11-0Dec 3, 2025
42 checks passed
@Lee-W
Copy link
Member

Super! Thanks so much!

benediktziegler reacted with heart emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@woilewoilewoile left review comments

@Lee-WLee-WLee-W approved these changes

@noirbizarrenoirbizarreAwaiting requested review from noirbizarrenoirbizarre is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

4.11.0

Development

Successfully merging this pull request may close these issues.

3 participants

@benediktziegler@Lee-W@woile

[8]ページ先頭

©2009-2025 Movatter.jp