Skip to content

Discussion: Clarify / standardize behavior for negative message_length_limit (should it require >= 0?) #1909

@ttw225

Description

@ttw225

Description

I’d like to start a discussion about how message_length_limit should behave when it is set to a negative value.

My current thinking is that message_length_limit should be limited to non-negative integers (>= 0), and that negative values should be rejected with an error.

To help explore this direction, I’ve also opened a PR: #1908 .

Steps to reproduce

  • cz check -l -1 --message "feat: hello"
  • cz commit -l -1

Current behavior

negative message_length_limit equals to no limit

Desired behavior

I’d like to clarify the intended behavior and, if this matches the expected design, make it consistent:

  • message_length_limit < 0 raises an error.
  • message_length_limit = 0 disables the length limit.
  • Leaving it unset in the CLI, or explicitly passing None, falls back to the config value consistently.

If maintainers prefer a different policy, I’d be happy to adjust the PR accordingly.

Screenshots

No response

Environment

Commitizen Version: 4.13.9
Python Version: 3.14.3 (main, Feb 3 2026, 15:32:20) [Clang 15.0.0 (clang-1500.1.0.2.5)]
Operating System: Darwin

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