Skip to content

Conversation

bastien31
Copy link

@bastien31 bastien31 commented Aug 12, 2025

Add a configuration (disable by default) to allow exclamation in commit title to ease identify BC simple git log parsing.

Description

Conventional commit allow to put breaking change exclamation character in git commit title.
This is a useful convention to identify BC commit from the title only.
As it is supported in commitizen parsing, add the option to generate it.

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

When running poetry doc, any broken internal documentation links will be reported in the console output like this:

INFO    -  Doc file 'config.md' contains a link 'commands/bump.md#-post_bump_hooks', but the doc 'commands/bump.md' does not contain an anchor '#-post_bump_hooks'.

Expected Behavior

Steps to Test This Pull Request

Additional Context

@bastien31 bastien31 changed the title Allow exclamation on breaking change for conventional commit [draft] Allow exclamation on breaking change for conventional commit Aug 12, 2025
@bastien31 bastien31 marked this pull request as draft August 12, 2025 11:13
@bastien31 bastien31 changed the title [draft] Allow exclamation on breaking change for conventional commit Allow exclamation on breaking change for conventional commit Aug 12, 2025
@bastien31 bastien31 force-pushed the dev/sfusilier/exclamation_bc_cc branch from 79a72cd to dad2e40 Compare August 12, 2025 11:21
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.25%. Comparing base (120d514) to head (2dac9eb).
⚠️ Report is 807 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1576      +/-   ##
==========================================
+ Coverage   97.33%   98.25%   +0.91%     
==========================================
  Files          42       58      +16     
  Lines        2104     2698     +594     
==========================================
+ Hits         2048     2651     +603     
+ Misses         56       47       -9     
Flag Coverage Δ
unittests 98.25% <100.00%> (+0.91%) ⬆️

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.

@bastien31 bastien31 changed the title Allow exclamation on breaking change for conventional commit Add exclamation on breaking change for conventional commit Aug 12, 2025
@bastien31 bastien31 changed the title Add exclamation on breaking change for conventional commit Add exclamation on commit title for breaking change for conventional commit Aug 12, 2025
@bastien31 bastien31 changed the title Add exclamation on commit title for breaking change for conventional commit feat(conventional_commits): Add exclamation on commit title for breaking change Aug 12, 2025
@bastien31
Copy link
Author

Tested manually:
image
image

@bastien31 bastien31 marked this pull request as ready for review August 13, 2025 06:12
@github-actions github-actions bot added the type: feature A new enhacement proposal label Aug 13, 2025
@Lee-W Lee-W changed the base branch from master to v4-9-0-test August 13, 2025 13:34
@Lee-W Lee-W added this to the 4.9.0 milestone Aug 13, 2025
@bastien31 bastien31 force-pushed the dev/sfusilier/exclamation_bc_cc branch 2 times, most recently from cf7c06d to f69f73f Compare September 1, 2025 14:34
@Lee-W Lee-W modified the milestones: 4.9.0, 4.10.0 Sep 9, 2025
@Lee-W Lee-W deleted the branch commitizen-tools:master September 9, 2025 06:09
@Lee-W Lee-W closed this Sep 9, 2025
@Lee-W Lee-W reopened this Sep 9, 2025
@Lee-W Lee-W changed the base branch from v4-9-0-test to master September 9, 2025 06:19
@bastien31 bastien31 force-pushed the dev/sfusilier/exclamation_bc_cc branch from f69f73f to 186fbd8 Compare September 9, 2025 13:47
@bastien31
Copy link
Author

bastien31 commented Sep 9, 2025

After a rebase on master, I had to add following fix 186fbd83fc7d2fa8c363fa2a08a7d901a657517c to get tests passed.
Also, on my side, I need to add "deprecated" library to get commitizen running.

@Lee-W
Copy link
Member

Lee-W commented Sep 9, 2025

yep, this needs #1591 to be merged

Comment on lines 157 to 160
# Check if breaking change exclamation in title is enabled
breaking_change_exclamation_in_title = self.config.settings.get(
"breaking_change_exclamation_in_title", False
)
Copy link
Contributor

Choose a reason for hiding this comment

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

How about

title = f"{prefix}{scope}"
if is_breaking_change and self.config.settings.get("breaking_change_exclamation_in_title"):
    title += "!"

Copy link
Author

Choose a reason for hiding this comment

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

Ok for the simplification, I would suggest something a little bit different to keep footer handling.

Add a configuration (disable by default) to allow exclamation in
commit title to ease identify BC simple git log parsing.

Signed-off-by: Sebastien Fusilier <sebastien.fusilier@gmail.com>
Force consistent terminal width for tests to avoid wrapping differences
between single and multi-worker pytest modes

Signed-off-by: Sebastien Fusilier <sebastien.fusilier@gmail.com>
@bastien31 bastien31 force-pushed the dev/sfusilier/exclamation_bc_cc branch from 186fbd8 to 2dac9eb Compare October 3, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants