-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Describe the bug
- I defined a custom configuration file (see below) that ignores an empty type, but fails when a type other than "chore" is supplied.
- I ran
commitlint --from HEAD~1 --to HEAD~1on a commit that only had a description, no type or scope. - Validation failed with the message:
type is not allowed. Only ["cli"] are allowed
The same also happens with the scope and scope-empty rules.
Curiously, the same also still happens if you explicitly set options: [""] to say that the only valid types/scopes are an empty string.
Config
rules:
type:
level: error
options: ["chore"]
type-empty:
level: ignoreError message
N/A
Expected behavior
The type-empty and scope-empty rules already validate an empty type or scope, so the type and scope rules shouldn't do this again. From what I can see, this problem currently makes it impossible to define the ruleset that supplying a type/scope should generally be optional, but that if it is supplied, only certain types/scopes are accepted.
Version
# Run the following command
$ commitlint --version
commitlint-rs 0.1.6Additional context
As an additional wish, I would like for it to be valid to define options in the type/scope rules as an empty array. That way it would be possible to, for instance, set up a repository in which supplying a scope is never allowed (only a type + description, for instance).