| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> commitizen-tools#2079
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #2080 +/- ##
==========================================
+ Coverage 98.19% 98.26% +0.07%
==========================================
Files 61 61
Lines 2829 2829
==========================================
+ Hits 2778 2780 +2
+ Misses 51 49 -2 ☔ View full report in Codecov by Harness. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
Fix body_length_limit so it preserves intentional blank lines in commit bodies while still wrapping non-empty lines to the configured width.
Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot CLI following the guidelines
Code Changes
Documentation Changes
Expected Behavior
With body_length_limit enabled, Commitizen should preserve blank lines in the commit body and only wrap long non-empty lines.
Steps to Test This Pull Request
Configure body_length_limit = 80 or run cz commit --body-length-limit 80.
Create a commit message body with a paragraph break, for example:
Confirm the generated commit message still contains the blank separator line.
Run uv run pytest tests/commands/test_commit_command.py -k body_length_limit.
Run uv run ruff check commitizen/commands/commit.py tests/commands/test_commit_command.py.
Run uv run ruff format --check commitizen/commands/commit.py tests/commands/test_commit_command.py.
Additional Context
This fixes a regression where textwrap.wrap("") caused empty body lines to be dropped when body_length_limit was enabled (#2079).