Skip to content

False positives when using the slash symbol ("/") in scope #262

@yenbekbay

Description

@yenbekbay

If you include the slash symbol (/) in the scope of a commit message, subject-empty and type-empty rules start throwing errors.

Current Behavior

For the commit message feat(components/Component): subject, I am currently getting the following output:

> commitlint -e

⧗   input: feat(components/Component): subject
✖   message may not be empty [subject-empty]
✖   type may not be empty [type-empty]
✖   found 2 problems, 0 warnings

Expected Behavior

The commit message feat(components/Component): subject should pass.

Affected packages

Not sure.

Possible Solution

Not sure.

Steps to Reproduce (for bugs)

  1. Stage any changes.
  2. Commit the changes with the message that has a slash in the scope – e.g. feat(components/Component): subject
  3. Run commitlint -e
commitlint.config.js
module.exports = {
  extends: ['@anvilabs/commitlint-config'],
};

Context

Can't use scopes with slashes in them.

Your Environment

Executable Version
commitlint --version 6.0.2
git --version 2.16.1
node --version 9.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions