Title: feat(config): warn on unknown configuration keys by bearomorphism · Pull Request #1961 · commitizen-tools/commitizen · GitHub
Open Graph Title: feat(config): warn on unknown configuration keys by bearomorphism · Pull Request #1961 · commitizen-tools/commitizen
X Title: feat(config): warn on unknown configuration keys by bearomorphism · Pull Request #1961 · commitizen-tools/commitizen
Description: Description Closes #300. Adds a new strict_config boolean setting that controls how unknown keys inside the commitizen configuration section are handled. Default (strict_config = false) – unknown keys emit a warning so typos like update_changelog_on_bumb are surfaced without breaking existing setups. strict_config = true – the same condition raises InvalidConfigurationError (exit code INVALID_CONFIGURATION), behaving like pytest --strict-markers. This matches the direction agreed in the issue discussion (#300 (comment)): warnings by default, strict mode opt-in. Implementation Settings (commitizen/defaults.py) gains strict_config: bool and a derived KNOWN_SETTINGS_KEYS constant. BaseConfig._validate_known_keys (commitizen/config/base_config.py) computes the unknown keys, raises in strict mode, and warns otherwise. Each concrete parser (TomlConfig, JsonConfig, YAMLConfig) calls the helper with the loaded section. New tests in tests/test_conf.py cover the warning, strict-mode error, and no-op cases for all supported config formats. Added a strict_config section to docs/config/option.md. Out of scope Type validation of values – mentioned as a follow-up in the discussion. Could be done in a later PR using decli's argparse-based typing. CLI flag mirroring pytest --strict-markers. Users can set the option in the config file; a CLI flag can be added later if needed. Checklist Add tests Update documentation uv run poe format / uv run poe lint clean Existing test suite green locally on Windows
Open Graph Description: Description Closes #300. Adds a new strict_config boolean setting that controls how unknown keys inside the commitizen configuration section are handled. Default (strict_config = false) – unknown ...
X Description: Description Closes #300. Adds a new strict_config boolean setting that controls how unknown keys inside the commitizen configuration section are handled. Default (strict_config = false) – unknown ...
Opengraph URL: https://github.com/commitizen-tools/commitizen/pull/1961
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2db3cae3-e6a7-7bb0-3cbf-24436a962574 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E2E0:6E445:39EF4:53BA5:6A634D7B |
| html-safe-nonce | fe9987655d8b90af99d67823e16528d77e2ee0734f7ec2072bd6edc6b490ab14 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkUwOjZFNDQ1OjM5RUY0OjUzQkE1OjZBNjM0RDdCIiwidmlzaXRvcl9pZCI6IjQyOTQzNDQ0MzMwMzc2OTIyODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9ab2804beee44009e1786412da777d117d6bead1c5bb2ed7eecc8dadc26711f7 |
| hovercard-subject-tag | pull_request:3654447209 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/commitizen-tools/commitizen/pull/1961/files |
| twitter:image | https://avatars.githubusercontent.com/u/26526132?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/26526132?s=400&v=4 |
| og:image:alt | Description Closes #300. Adds a new strict_config boolean setting that controls how unknown keys inside the commitizen configuration section are handled. Default (strict_config = false) – unknown ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git |
| octolytics-dimension-user_id | 62252524 |
| octolytics-dimension-user_login | commitizen-tools |
| octolytics-dimension-repository_id | 106127589 |
| octolytics-dimension-repository_nwo | commitizen-tools/commitizen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 106127589 |
| octolytics-dimension-repository_network_root_nwo | commitizen-tools/commitizen |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 990295d92a4cc7b63fbbd83a046217cd7d77d49c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width