Skip to content

description-max-length and description-empty rules trigger incorrectly #257

@cengels

Description

@cengels

Describe the bug

Sorry for the many bug reports, but I hope this will help make commitlint-rs better!

  1. With a configuration file like the below,
  2. I tested a simple commit message like git commit -m "s"
  3. The validation fails with the following output:
description is empty or missing space in the beginning
description is longer than 72 characters
type is empty

If a type is supplied (like git commit -m "chore: s"), all 3 errors go away.

Config

rules:
  body-empty:
    level: ignore
  description-empty:
    level: error
  description-max-length:
    level: error
    length: 72
  type-empty:
    level: error

Error message

N/A

Expected behavior

Only the message type is empty should be printed here, as there is a non-empty description and it is not longer than the description-max-length.

Version

# Run the following command
$ commitlint --version
commitlint-rs 0.1.6

Additional context

N/A

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions