Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The character "/" triggers unexpected errors #291

Closed
2 of 4 tasks
dispix opened this issue Feb 22, 2018 · 4 comments
Closed
2 of 4 tasks

The character "/" triggers unexpected errors #291

dispix opened this issue Feb 22, 2018 · 4 comments
Labels

Comments

@dispix
Copy link

dispix commented Feb 22, 2018

Expected Behavior

I can add a / in the scope to define it more precisely

tech(components/StandardLayout): add an uncontrolled state

Current Behavior

The / character triggers multiple warnings:

⧗   input: tech(components/StandardLayout): add an uncontrolled state
✖   message may not be empty [subject-empty]
✖   type may not be empty [type-empty]
✖   scope may not be empty [scope-empty]
✖   found 3 problems, 0 warnings

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

In previous versions, the / character was not triggering these errors (tested with "@commitlint/cli": "5.2.0").

Your Environment

Mac OSX 10.13.2

Executable Version
commitlint --version 6.1.0
git --version 2.16.1
node --version 9.5.0
@marionebl marionebl added the bug label Feb 22, 2018
@marionebl
Copy link
Contributor

marionebl commented Feb 22, 2018

Please share the commitlint.config.js you use, the output hints you are not using @commitlint/config-conventional


Can't reproduce your issue with a fresh install. Any chance you provided a custom parserPreset?

λ mkdir test
λ cd test
λ npm install @commitlint/{cli,config-conventional}
λ echo "module.exports = { extends: ['@commitlint/conventional'] };" > commitlint.config.js

λ echo "tech(components/StandardLayout): add an uncontrolled state" | ./node_modules/.bin/commitlint
⧗   input: tech(components/StandardLayout): add an uncontrolled state
✖   scope must be lower-case [scope-case]
✖   type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]
✖   found 2 problems, 0 warnings

λ echo "feat(components/standard-layout): add an uncontrolled state" | ./node_modules/.bin/commitlint
⧗   input: feat(components/standard-layout): add an uncontrolled state
✔   found 0 problems, 0 warnings

@dispix
Copy link
Author

dispix commented Feb 23, 2018

Here is the configuration from my package.json:

{
  "commitlint": {
    "extends": [
      "@commitlint/config-conventional"
    ],
    "rules": {
      "scope-case": [
        2,
        "always",
        "camel-case"
      ],
      "scope-empty": [
        2,
        "never"
      ],
      "type-enum": [
        2,
        "always",
        [
          "feat",
          "fix",
          "tech",
          "chore",
          "docs",
          "style",
          "test",
          "revert"
        ]
      ]
    }
}

@SimeonC
Copy link
Contributor

SimeonC commented Jul 2, 2018

I'm having the same problem in commitlint v6.2.0 with the following setup in a commitlint.config.js:

module.exports = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'scope-case': [2, 'always', ['camel-case', 'pascal-case', 'lower-case']]
  }
};

index js 2018-07-02 14-16-05

escapedcat added a commit to escapedcat/commitlint that referenced this issue Dec 23, 2018
marionebl pushed a commit that referenced this issue Jan 27, 2019
* test(rules): add test for slash in scope #291

* fix(ensure): split input by slashes for casing

* chore: remove comment
@marionebl
Copy link
Contributor

Will land with next release (presumably 7.4.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants