Skip to content

The "format" rules panic #255

@cengels

Description

@cengels

Describe the bug

What I did:

  1. Added a simple config (see below) consisting only of the example config on the description format page.
  2. Ran the command commitlint --from HEAD~1 --to HEAD~1 in a repository with existing commits
  3. Received the error below.

The same error also occurs with the "type format" and "scope format" rules. I tried changing the format regex a few times, but no matter the regex, the error always remained the same. After removing the configuration for the "description format" rule (and optionally adding a bunch of other rules), the error went away.

Config

rules:
  description-format:
    level: error
    format: ^[A-Z].*$

Error message

thread 'tokio-runtime-worker' panicked at /.cargo/registry/src/index.crates.io-6f17d22bba15001f/commitlint-rs-0.1.6/src/rule/description_format.rs:34:62:
called `Option::unwrap()` on a `None` value

Expected behavior

No error.

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