Commitlint: prompt-cli does not work with custom config file paths

Created on 10 May 2018  路  5Comments  路  Source: conventional-changelog/commitlint

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 |

feature help wanted

All 5 comments

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

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?

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?

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

texhnolyze picture texhnolyze  路  3Comments

thomasthiebaud picture thomasthiebaud  路  5Comments

chris-dura picture chris-dura  路  5Comments

ResDiaryLewis picture ResDiaryLewis  路  4Comments

nareshbhatia picture nareshbhatia  路  5Comments