commitlint icon indicating copy to clipboard operation
commitlint copied to clipboard

prompt-cli does not work with custom config file paths

Open n0nick opened this issue 7 years ago • 5 comments

Following #100, there is no way to run prompt-cli with a specific config file path. It just assumes the default which is commitlint.config.js under the repository's root.

Expected Behavior

Either:

  1. npm run commit --config </path/to/config.js>
  2. COMMITLINT_CONFIG=/path/to/config.js npm run commit
  3. { config: { '@commitlint/prompt-cli': { config: '/path/to/config.js' } } } in package.json

Current Behavior

prompt-cli runs with no customizations in place (no type/scope enums loaded etc.)

Affected packages

  • [ ] cli
  • [ ] core
  • [x] prompt
  • [ ] config-angular

Your Environment

Executable Version
commitlint --version 6.2.0
git --version 2.17.0
node --version 8.9.0

n0nick avatar May 09 '18 22:05 n0nick

A PR adding the needed functionality to prompt-cli is very welcome!

marionebl avatar Jun 02 '18 12:06 marionebl

I am facing the same issue. I wouldn't mind much doing this over the christmas break. Would a path or location configuration parameter in package.json be the right approach?

polaroidkidd avatar Dec 02 '20 22:12 polaroidkidd

Hey @polaroidkidd , I would suggest it should try to find the config in these (default) places: https://commitlint.js.org/#/guides-local-setup?id=install-commitlint and/or using the --path as described in this issue.
So we do not need another parameter to check for in the configs.
Does this make sense to you?

escapedcat avatar Dec 03 '20 06:12 escapedcat

Hii @escapedcat

Thank you for your input and I agree with you (less additional parameter checks === less room for errors in my view).

I've forked the repo, had a look around and from what I can see I don't think it's too complicated to implement. If I have any questions I'll post them here.

polaroidkidd avatar Dec 03 '20 08:12 polaroidkidd

Welcome! Yeah, please do. You ask in the chat as well if you want: https://devtoolscommunity.herokuapp.com

escapedcat avatar Dec 03 '20 09:12 escapedcat