commitizen / commitizen/cz-cli

Provide easier access to commitizen config to prompters

オープン
#757 コメント 2 件 リアクション 3 件 担当者 0 名 GitHub で見る
adapter enhancement
主要言語
JavaScript
スター
17.5k
フォーク
566
平均マージ
8時間 16分
マージ済み PR(30日)
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 を短くまとめたダイジェスト。