Description
The body_length_limit setting is ignored by cz commit when it is configured
in a project configuration file. Passing --body-length-limit explicitly works.
The CLI parser includes body_length_limit=None in the command arguments when
the option is omitted. Commit._wrap_body() uses dict.get(key, default), so
that None masks the configured value instead of falling back to it.
Steps to reproduce
-
Configure Commitizen with:
[tool.commitizen]
body_length_limit = 80
-
Run cz commit.
-
Enter a commit body containing a line longer than 80 characters.
-
Complete the commit and inspect its message.
Current behavior
The body line remains longer than 80 characters. The configured limit is only
applied when --body-length-limit 80 is passed explicitly.
Desired behavior
When the CLI option is omitted, cz commit should use the configured
body_length_limit. An explicit --body-length-limit 0 should continue to
disable wrapping.
Screenshots
Not applicable.
Environment
Commitizen Version: 4.19.0
Python Version: 3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0]
Operating System: Linux
Description
The
body_length_limitsetting is ignored bycz commitwhen it is configuredin a project configuration file. Passing
--body-length-limitexplicitly works.The CLI parser includes
body_length_limit=Nonein the command arguments whenthe option is omitted.
Commit._wrap_body()usesdict.get(key, default), sothat
Nonemasks the configured value instead of falling back to it.Steps to reproduce
Configure Commitizen with:
Run
cz commit.Enter a commit body containing a line longer than 80 characters.
Complete the commit and inspect its message.
Current behavior
The body line remains longer than 80 characters. The configured limit is only
applied when
--body-length-limit 80is passed explicitly.Desired behavior
When the CLI option is omitted,
cz commitshould use the configuredbody_length_limit. An explicit--body-length-limit 0should continue todisable wrapping.
Screenshots
Not applicable.
Environment