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?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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