Repository: conventional-changelog/commitlint

Issue #341: Slashs and commas are not allowd in scope?
Created: 2018-05-16T09:30:14Z
Expected Behavior


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

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


Current Behavior


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


Affected packages

 cli
 core
 prompt
 config-angular

Possible Solution


Steps to Reproduce (for bugs)
https://github.com/Stupidism/cra-rewired-starter/tree/3a1c47cdcda5f585c529f78b246bc470ce64c526

  commitlint.config.js
  
  
```js
```

Context


Your Environment

➜  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",




Executable
Version




commitlint --version
VERSION


git --version
VERSION


node --version
VERSION

Duplicate issue #445: Different results from the same commit message between cli and actual commit
Created: 2018-09-16T15:16:52Z
Expected Behavior


Below two commands should be passed in my config. At least the same result should be output.
$ cat .git/COMMIT_EDITMSG | npx commitlint
$ git commit -m "chore(component,demo): bump"
Current Behavior


$ cat .git/COMMIT_EDITMSG | npx commitlint
⧗   input: chore(component,demo): bump
✔   found 0 problems, 0 warnings
Above command passed but below failed.
$ git commit -m "chore(component,demo): bump"
husky > commit-msg (node v8.12.0)
.git/COMMIT_EDITMSG
⧗   input:
chore(component,demo): bump

✖   scope may not be empty [scope-empty]
✖   message may not be empty [subject-empty]
✖   type may not be empty [type-empty]
✖   found 3 problems, 0 warnings
husky > commit-msg hook failed (add --no-verify to bypass)

Affected packages

[?] cli
[?] core
[?] prompt
[?] config-angular

Possible Solution


Steps to Reproduce (for bugs)









  commitlint.config.js
  
  
```js
```

Context


Your Environment

package.json:
{
  "name": "root",
  "private": true,
  "devDependencies": {
    "husky": "^1.0.0-rc.14",
    "js-combinatorics": "^0.5.3",
    "lerna": "^3.3.1",
    "wsrun": "^2.2.1"
  },
  "workspaces": [
    "packages/*"
  ],
  "dependencies": {
    "@babel/cli": "^7.0.0",
    "@babel/core": "^7.0.1",
    "@babel/preset-env": "^7.0.0",
    "@babel/preset-react": "^7.0.0",
    "@commitlint/cli": "^7.1.2",
    "@commitlint/config-conventional": "^7.1.2",
    "babel-eslint": "^9.0.0",
    "eslint": "^5.5.0",
    "eslint-plugin-react": "^7.11.1"
  },
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/b6pzeusbc54tvhw5jgpyw8pwz2x6gs/react-utterances.git"
  }
}
// commitlint.config.js
const Combinatorics = require('js-combinatorics')

const scopeList = ['root','component','demo']
const scopeEnumList = []

Combinatorics.power(scopeList).forEach( subset => {
  if( subset.length < 1 ) return

  const isAll = subset.length === scopeList.length
  scopeEnumList.push( isAll ? 'all' : subset.join(','))
})

module.exports = {
  rules: {
    'body-leading-blank': [1, 'always'],
    'footer-leading-blank': [1, 'always'],
    'header-max-length': [2, 'always', 72],
    'scope-case': [2, 'always', 'lower-case'],
    'scope-enum': [2, 'always', scopeEnumList],
    // scopeEnumList: [ 'root',  'component',  'root,component',  'demo',  'root,demo',  'component,demo',  'all' ]
    'scope-empty': [2, 'never'],
    'subject-case': [2, 'never', ['sentence-case','start-case','pascal-case','upper-case']],
    'subject-empty': [2, 'never'],
    'subject-full-stop': [2, 'never', '.'],
    'type-case': [2, 'always', 'lower-case'],
    'type-empty': [2, 'never'],
    'type-enum': [2, 'always', ['build','chore','ci','docs','feat','fix','perf','refactor','revert','style','test','dx']],
  }
}
version:
$ npx commitlint --version
7.1.2
$ git --version
git version 2.15.2 (Apple Git-101.1)
$ node --version
v8.12.0

Closing comment (2018-10-09T19:31:37Z): Probably a duplicate of #341