Skip to content

Configured body_length_limit is ignored by cz commit #2093

Description

@schlotter

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

  1. Configure Commitizen with:

    [tool.commitizen]
    body_length_limit = 80
  2. Run cz commit.

  3. Enter a commit body containing a line longer than 80 characters.

  4. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions