Skip to content

Add config option for line length warning (-l/--message-length-limit) #1571

Closed

Description

@mattgebert

Description

In issue #191, it was suggested to be able to add command line arguments to commitizen to ensure the correct line length, implemented in #1076. This was further updated in #1178 to allow the same argument to be used in check in addition to commit.

Examples:

cz commit -l/--message-length-limit N

or

cz check -l N -m MESSAGE

However, the is not yet support in config or customisation to add such a default argument without requiring the command line specification.

Possible Solution

An additional config option should exist in the configuration file to optionally define a commit line length.
This would then be utilised by both commitizen pre-commit [commit-msg, pre-push] hooks and command line invocations on the root directory of a project (i.e. with the relevant pyproject.toml for a python package).

pyproject.toml

[tool.commitizen]
name = "cz_customize"

[tool.commitizen.customize]
  ... 
  message_length_limit = 72  # or l=72?

Then allowing the default parameter to propagate as follows:

cz commit
>>> fails / succeeds depending on message length

cz check -m MESSAGE
>>> fails / succeeds depending on message length

Additional context

No response

Related issues

No response

Activity

  1. added
    type: feature
    on Aug 7, 2025
  2. Lee-W commented on Aug 8, 2025

    @Lee-W
    Member

    looks like a valid feature. Thanks for suggestion!

  3. added theissue type on Aug 8, 2025
  4. Narwhal-fish commented on Aug 11, 2025

    @Narwhal-fish
    Contributor

    Hi @Lee-W, I'd be happy to help with this one. May I take it?

  5. Lee-W commented on Aug 11, 2025

    @Lee-W
    Member

    yep, sure :)

  6. bearomorphism commented on Dec 3, 2025

    @bearomorphism
    Collaborator

    I'm closing this issue as completed. Thanks @Narwhal-fish :)

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

Metadata

Metadata

Assignees

Labels

good first issuetype: feature

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions