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(conventional_commits): add ability to overide settings from tool... #1570

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

Open
AxTheB wants to merge 2 commits into commitizen-tools:master
base: master
Choose a base branch
Loading
from AxTheB:feat/customizable-conventional-commits

Conversation

Copy link

@AxTheB AxTheB commented Aug 7, 2025

....commitizen.customize

Description

Adds ability to override settings using [tool.commitizen.customize] in the cz_conventional_commits

Checklist

Code Changes

  • Add test cases to all the changes you introduce
  • Run poetry all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

Documentation Changes

  • Run poetry doc locally to ensure the documentation pages renders correctly
  • Check and fix any broken links (internal or external) in the documentation

Expected Behavior

You use conventional_commits commitizen, and using [tool.commitizen.customize] config section you override selected settings

Steps to Test This Pull Request

Add this to pyproject.tomp in existing project using conventional_commits and update_changelog_on_bump = true:

[tool.commitizen.customize]
change_type_map = {"feat" = "✨ Feat", "fix" = "🐛 Bug Fix", "refactor" = "♻️ Refactor", "perf" = "⚡️ Perf"}

do cz bump --dry-run and observe that changelog headers have gitmoji.
Test that other behavior is identical to unpatched version
test that
bump_map = {"^.+!$" = "MAJOR", "^feat" = "MAJOR", "^fix" = "MINOR", "^refactor" = "MINOR", "^perf" = "MINOR"} bumps MINOR not PATCH part on fix commit, test that other things are unchanged.
Test other settings.

Additional Context

This is starting shot at #1385
To test this I copied tests for cz_customize, removed name=... from all configs there and removed the tests that don't make
sense, for example exception for missing customize section.

Copy link

codecov bot commented Aug 7, 2025
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.98%. Comparing base (120d514) to head (3129cd6).
⚠️ Report is 755 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@
## master #1570 +/- ##
==========================================
+ Coverage 97.33% 97.98% +0.64% 
==========================================
 Files 42 58 +16 
 Lines 2104 2723 +619 
==========================================
+ Hits 2048 2668 +620 
+ Misses 56 55 -1 
Flag Coverage Δ
unittests 97.98% <100.00%> (+0.64%) ⬆️

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.

Copy link
Author

AxTheB commented Aug 7, 2025

I decided not to drag in the jinja2.Template/string.Template dichotomy, as jinja2 is project dependency so the string.Template part will be unused.

@Lee-W Lee-W added this to the 4.9.0 milestone Aug 17, 2025
@Lee-W Lee-W modified the milestones: 4.9.0, 4.10.0 Sep 9, 2025
@Lee-W Lee-W self-assigned this Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@woile woile Awaiting requested review from woile woile is a code owner

@Lee-W Lee-W Awaiting requested review from Lee-W Lee-W is a code owner

@noirbizarre noirbizarre Awaiting requested review from noirbizarre noirbizarre is a code owner

At least 1 approving review is required to merge this pull request.

Labels
Projects
None yet
Milestone
4.10.0
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /