commitizen / commitizen/cz-cli

Provide easier access to commitizen config to prompters

Open
#757 2 comments 3 reactions 0 assignees View on GitHub
adapter enhancement
Dominant language
JavaScript
Stars
17.5k
Forks
566
Avg merge
8h 16m
Merged PRs (30d)
1

Description

Currently when writing a prompter, e.g., cz-conventional-commit, if you wish to integrate with commitizen configuration then you need to do the following:

```
var configLoader = require('commitizen').configLoader;
configLoader.load() // synchronous, not a promise
```

I think it'd be nicer to actually have commitizen inject said configuration into prompters, e.g.,

```
module.exports = {
prompter: function myAdapter(inquirer, config, commit) {
}
}
```

This would remove the backwards dependency from prompters to commitizen, and reduce the need to test that config actually was loaded correctly when testing prompters, and allow for standardised configuration between all prompters. It could also be done in a backwards compatible manner by checking the length of the prompter function (that tells you how many arguments it expects)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.