feat(bump): implements ignore_bump_*#1853
feat(bump): implements ignore_bump_*#1853namwoam wants to merge 5 commits intocommitizen-tools:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1853 +/- ##
=======================================
Coverage 97.99% 98.00%
=======================================
Files 60 60
Lines 2692 2702 +10
=======================================
+ Hits 2638 2648 +10
Misses 54 54 ☔ View full report in Codecov by Sentry. |
|
Hello @bearomorphism , this PR is ready. Please help me rename this PR to |
|
I remember the author can edit the PR title and description. That is strange |
There was a problem hiding this comment.
Pull request overview
Adds support for excluding specific commits from version bump detection, allowing users to avoid bumps triggered by selected revisions or authors (addresses issue #1772).
Changes:
- Extend bump increment detection to skip commits by revision (
ignore_bump_rev_list) or author (ignore_bump_author_list). - Wire new config settings through the
cz bumpcommand into the increment finder. - Add tests and user documentation for the new configuration options.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
commitizen/bump.py |
Adds ignore-by-rev/author filtering while scanning commits for bump keywords. |
commitizen/commands/bump.py |
Reads ignore lists from config and passes them into bump.find_increment. |
commitizen/defaults.py |
Extends Settings typing to include the new config keys. |
tests/test_bump_find_increment.py |
Adds unit tests covering rev-based and author-based ignore behavior. |
docs/config/bump.md |
Documents the new ignore_bump_* configuration options with examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| if ignore_bump_author_list and commit.author in ignore_bump_author_list: | ||
| logger.debug( | ||
| f"Skipping commit {commit.rev} as its author '{commit.author}' is in ignore_bump_author_list" |
There was a problem hiding this comment.
The debug log message on this line exceeds the configured formatter/linter max line length (88 in pyproject.toml). Please wrap/reformat the string (or split it across lines) to avoid CI formatting/lint failures.
| f"Skipping commit {commit.rev} as its author '{commit.author}' is in ignore_bump_author_list" | |
| "Skipping commit %s as its author '%s' is in ignore_bump_author_list", | |
| commit.rev, | |
| commit.author, |
There was a problem hiding this comment.
Need to check what logger actually does
| Here’s a clearer, more consistent rewrite with tightened wording, corrected descriptions, and parallel structure between the two options. | ||
|
|
||
| ## `ignore_bump_rev_list` | ||
|
|
||
| - Type: `list` | ||
| - Default: `[]` |
There was a problem hiding this comment.
This sentence reads like meta commentary about the doc rewrite rather than user-facing documentation. Please remove it (or replace it with content that describes the settings) so the config page stays focused and professional.
| Here’s a clearer, more consistent rewrite with tightened wording, corrected descriptions, and parallel structure between the two options. | |
| ## `ignore_bump_rev_list` | |
| - Type: `list` | |
| - Default: `[]` | |
| ## `ignore_bump_rev_list` | |
| - Type: `list` | |
| - Default: `[]` | |
| - Type: `list` | |
| - Default: `[]` |
|
|
||
| See [`--version-scheme`](../commands/bump.md#-version-scheme). | ||
|
|
||
| Here’s a clearer, more consistent rewrite with tightened wording, corrected descriptions, and parallel structure between the two options. |
| ignore_bump_rev_list: list[str] | None = None, | ||
| ignore_bump_author_list: list[str] | None = None, |
There was a problem hiding this comment.
do we need these new parameters to be optional?
|
I don't get this PR, it doesn't have any test reproducing the issue mentioned in the original ticket. |
Description
This PR will let user select commits that shouldn't be bump version. Solve #1772
Checklist
Was generative AI tooling used to co-author this PR?
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsDocumentation Changes
uv run poe doclocally to ensure the documentation pages renders correctlyExpected Behavior
Steps to Test This Pull Request
Steps to reproduce the behavior:
test.txtsuppose got the following git log:
ignore_bump_rev_list=["e302cb4f2c626099b4a9c8cf881b0bb5906b7356"]orignore_bump_author_list=["andre.liang"]to ignore this commit from version bump calculation.cz bumpwill produce:Additional Context