KeisukeYamashita / commitlint-rs

🔦 Lint commit messages with conventional commit messages
https://keisukeyamashita.github.io/commitlint-rs
Apache License 2.0
32 stars 8 forks source link

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

Closed cengels closed 8 months ago

cengels commented 8 months ago

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

KeisukeYamashita commented 8 months ago

Thanks for your report, I'll check it soon 🙏

cengels commented 8 months ago

@KeisukeYamashita I tested this in 0.1.8 and the original problem doesn't appear anymore, but now it seems the description-empty rule can't be triggered anymore at all? If I type echo "" | commitlint with description-empty.level: error, the validation passes without errors.

KeisukeYamashita commented 8 months ago

@cengels Opps, it might be a bug, let me check it later! Thank you for your report!!!