commitizen / commitizen/cz-cli

Provide easier access to commitizen config to prompters

未关闭
#757 2 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
adapter enhancement
主要语言
JavaScript
星标
17.5k
派生
566
平均合并
8 小时 16 分钟
30 天内合并 PR
1

描述

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)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。