question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Stupidismcommented, May 9, 2018

@marionebl It’s happening again and it’s different. Example repo is here.

Looks like there’s an extra new-line before my commit message:

➜  cra-rewired-starter git:(master) ✗ gc -m "feat(store/modules): add runtime"
husky > npm run -s precommit (node v8.11.1)

 ✔ Running tasks for {src,config}/**/*.{js,jsx,json}
 ↓ Running tasks for src/**/*.{css,less} [skipped]
   → No staged files match src/**/*.{css,less}
husky > npm run -s commitmsg (node v8.11.1)

⧗   input:
feat(store/modules): add runtime

✖   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

without slash:

➜  cra-rewired-starter git:(master) ✗ gc -m "feat(store-modules): add runtime"
husky > npm run -s precommit (node v8.11.1)

 ✔ Running tasks for {src,config}/**/*.{js,jsx,json}
 ↓ Running tasks for src/**/*.{css,less} [skipped]
   → No staged files match src/**/*.{css,less}
husky > npm run -s commitmsg (node v8.11.1)

⧗   input: feat(store-modules): add runtime
✔   found 0 problems, 0 warnings

version:

➜  cra-rewired-starter git:(master) ✗ node -v
v8.11.1
➜  cra-rewired-starter git:(master) npm -v
6.0.0
➜ cra-rewired-starter git:(master) ✗ grep 'version' node_modules/@commitlint/cli/package.json
    "type": "version",
  "version": "6.2.0",

cli-test:

➜  cra-rewired-starter git:(master) ✗ echo "feat(components, component): subject" | ./node_modules/.bin/commitlint
⧗   input: feat(components, component): subject
✔   found 0 problems, 0 warnings

➜  cra-rewired-starter git:(master) ✗ echo "feat(components/component): subject" | ./node_modules/.bin/commitlint
⧗   input: feat(components/component): subject
✔   found 0 problems, 0 warnings

1reaction
marioneblcommented, Feb 3, 2018

Fixed via 6.1.0. Let me know if you still run into problems!

λ commitlint -v
6.1.0

λ echo "feat(components/component): subject" | commitlint
⧗   input: feat(components/component): subject
✔   found 0 problems, 0 warnings

λ echo "feat(components, component): subject" | commitlint
⧗   input: feat(components, component): subject
✔   found 0 problems, 0 warnings
Read more comments on GitHub >

github_iconTop Results From Across the Web

7 Common errors in the usage of symbols in scientific writing
In this article, we have highlighted some common errors in the usage of symbols that we have come across in physical science and...
Read more >
APL syntax and symbols - Wikipedia
The programming language APL is distinctive in being symbolic rather than lexical: its ... boolean 0s delete items using the dyadic / slash...
Read more >
The Basics — The Swift Programming Language (Swift 5.7)
Swift also makes extensive use of variables whose values can't be changed. ... Wrap the name in parentheses and escape it with a...
Read more >
Improving agile requirements: the Quality User Story ...
Symbols cause the vast majority of false positives in our set of user stories. We want to resolve these without introducing new false...
Read more >
Java Flashcards - Quizlet
The method with the declaration public static int aMethod() has a method type of ____. int. Identify the false statement.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found