commitizen / commitizen/cz-cli

Provide easier access to commitizen config to prompters

Đang mở
#757 2 bình luận 3 reaction 0 người được giao Xem trên GitHub
adapter enhancement
Ngôn ngữ chính
JavaScript
Star
17.5k
Fork
566
Merge trung bình
8 giờ 16 phút
Pull request đã merge (30 ngày)
1

Mô tả

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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.