-
Notifications
You must be signed in to change notification settings - Fork 111
Description
Currently, git-cz already has its own configuration file resolution:
Lines 7 to 12 in e02bcb1
| const configFiles = [ | |
| '.git-cz.json', | |
| 'changelog.config.js', | |
| 'changelog.config.cjs', | |
| 'changelog.config.json' | |
| ]; |
And also able to resolve commitizen config via config.commitizen.changelog in package.json:
Lines 27 to 38 in e02bcb1
| const pkgFilename = path.join(dir, 'package.json'); | |
| if (fs.existsSync(pkgFilename)) { | |
| try { | |
| const changelog = require(pkgFilename).config.commitizen.changelog; | |
| if (changelog) { | |
| return changelog; | |
| } | |
| // eslint-disable-next-line no-empty | |
| } catch (error) {} | |
| } |
So it is already playing quite nice with commitizen's config, meaning we don't need to have an extra .git-cz.json or changelog.config.js file in our repository, as all git-cz configs can be stored alongside with commitizen config in package.json.
However, when we want to use commitizen globally, the convention is to use .czrc or .cz.json file in $HOME directory, which isn't supported in git-cz.
So I'm wondering if we could do the same with package.json by also recursively reading .czrc and .cz.json like what commitizen does?