commitizen-tools / commitizen

Create committing rules for projects :rocket: auto bump versions :arrow_up: and auto changelog generation :open_file_folder:
https://commitizen-tools.github.io/commitizen/
MIT License
2.44k stars 258 forks source link

Check unknown config in configuration file #300

Open Lee-W opened 3 years ago

Lee-W commented 3 years ago

Description

Check whether unknown configuration exists in the configuration file when strict_config=True is passed. It should work like --strict-markers in pytest. It can avoid typo in the configuration.

Possible Solution

  1. add strict_config as a configuration
  2. define the valid configurations
  3. check unknown key in base_config if strict_config=True

Additional context

Related Issue

woile commented 3 years ago

How would this work? What do you envision and what's the use case?

Lee-W commented 3 years ago

If any configuration not supported by commitizen exists in the section [tool.commitizen], any commtizen command should fail with an error message saying which configuration is not supported.

Days ago, I tried to reproduce #297, but forget that I didn't have the latest commitizen installed which does not yet support update_changelog_on_bump.

Also, I think it might be great if an user can list all the configuration through cli like pytest --fixtures does.