commitizen / commitizen/cz-cli

[Config loader] check if config key is in package.json before accepting it as a config file

未關閉
#975 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
17.5k
分支
566
平均合併
8 小時 16 分鐘
30 天內合併 PR
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

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。