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

Error when multiple values in scope-case #318

Closed
2 of 4 tasks
marceloavf opened this issue Apr 26, 2018 · 3 comments
Closed
2 of 4 tasks

Error when multiple values in scope-case #318

marceloavf opened this issue Apr 26, 2018 · 3 comments
Labels

Comments

@marceloavf
Copy link

marceloavf commented Apr 26, 2018

Expected Behavior

Allow multiple values in scope-case

Current Behavior

Throw an error when try to commit

husky > npm run -s commitmsg (node v8.11.1)
D:\Projetos\Git\inovafarma\node_modules\@commitlint\cli\lib\cli.js:70
        throw err;
        ^
TypeError: ensure-case: Unknown target case "lower-case,camel-case"
    at toCase (D:\Projetos\Git\inovafarma\node_modules\@commitlint\ensure\lib\case.js:73:10)
    at Object.ensureCase as case
    at exports.default (D:\Projetos\Git\inovafarma\node_modules\@commitlint\rules\lib\scope-case.js:29:26)
    at D:\Projetos\Git\inovafarma\node_modules\@commitlint\lint\lib\index.js:136:18
    at Array.map (<anonymous>)
    at D:\Projetos\Git\inovafarma\node_modules\@commitlint\lint\lib\index.js:117:8
    at <anonymous>
husky > commit-msg hook failed (add --no-verify to bypass)

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Steps to Reproduce (for bugs)

  1. Write commit fix(enum): test item
commitlint.config.js
module.exports = {
	rules: {
		'body-leading-blank': [1, 'always'],
		'footer-leading-blank': [1, 'always'],
		'header-max-length': [2, 'always', 100],
		'scope-case': [
            2,
            'always',
            ['lower-case', 'camel-case']
        ],
		'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'
			]
		]
	}
};
package.json
"scripts": {
    "commitmsg": "commitlint -e $GIT_PARAMS"
  },
  "devDependencies": {
    "@commitlint/cli": "^6.1.3",
    "@commitlint/config-conventional": "^6.1.3",
    "husky": "^0.14.3"
  }

Executable Version
commitlint --version 6.1.3
git --version 2.15.1
node --version 8.11.1
@marceloavf
Copy link
Author

Related to #312

@armano2
Copy link
Contributor

armano2 commented Dec 16, 2020

@escapedcat this issue got fixed in #312 as we are allowing array to be provided (tests are already in place)

@escapedcat
Copy link
Member

Thanks @armano2 !

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

4 participants