commitizen / commitizen/cz-cli
[Config loader] check if config key is in package.json before accepting it as a config file
- 主要言語
- JavaScript
- スター
- 17.5k
- フォーク
- 566
- 平均マージ
- 8時間 16分
- マージ済み PR(30日)
- 1
説明
Hello,
I'm working on a monorepo with backend and frontend and a `.czrc` at the directory's root to enforce commit rules with commitizen.
All frontend-related files are in a subdirectory, including the `package.json` file at different filesystem levels.
**My issue**: In a subdirectory with a package.json between `pwd` and git repository root, `commitizen` seems to acknowledge this file as a configuration file despite the lack of `config.commitizen` key.
**Fix proposal**: There seems to be a mechanism to check the package.json has a commitizen configuration, but it is commented: https://github.com/commitizen/cz-cli/blob/2e57fd02a5fd2b2dcf89d3235a6956edaeaf672c/src/configLoader/loader.js#L30-L36
I tried to uncomment it in a local version of commitizen, and it works as expected.
Would it be possible to uncomment it or does it have unwanted side effects?
コントリビューションガイド
調査の方向性
src/configLoader/loader.js の30-36行目から始めます。ここにはコメントアウトされた package.json の設定チェックがあります。サブディレクトリからリポジトリのルートに向かって設定ファイルがどのように検出されるかを追跡し、config.commitizen キーがある場合とない場合の動作を確認します。完了条件は、package.json がそのキーを宣言している場合にのみ受け入れられ、他の設定ソースを壊さないことです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, node.js
- 領域
- cli, tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100