Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Assignees
@mattgebert

Description

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

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /