Skip to content

refactor(config): replace is_empty_config with contains_commitizen_section, improve multi config resolution algorithm - #1842

Merged
bearomorphism merged 1 commit into
masterfrom
remove-is-empty-config
Feb 3, 2026
Merged

refactor(config): replace is_empty_config with contains_commitizen_section, improve multi config resolution algorithm#1842
bearomorphism merged 1 commit into
masterfrom
remove-is-empty-config

Conversation

@bearomorphism

@bearomorphism bearomorphism commented Feb 2, 2026

Copy link
Copy Markdown
Collaborator
  • Fixed incorrectly used samefile
  • Removed unnecessary same file check in _resolve_config_candidates. The tests already covered the cases "same git repo root and cwd" so it should not be broken after merging this PR.
  • Separate "empty configuration" detection and _parse_settings

Why removing is_empty_config?

Hmm, I believe a stateless function is easier to read in this case.

@codecov

codecov Bot commented Feb 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.99%. Comparing base (26e5d80) to head (2924fae).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1842   +/-   ##
=======================================
  Coverage   97.98%   97.99%           
=======================================
  Files          60       60           
  Lines        2686     2699   +13     
=======================================
+ Hits         2632     2645   +13     
  Misses         54       54           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bearomorphism
bearomorphism force-pushed the remove-is-empty-config branch from 40c5b7b to 922bf56 Compare February 2, 2026 17:20
Comment thread commitizen/config/base_config.py
Comment thread commitizen/config/toml_config.py Outdated
Comment thread commitizen/config/base_config.py
@bearomorphism
bearomorphism force-pushed the remove-is-empty-config branch from 922bf56 to ddadf1b Compare February 3, 2026 15:33
…ction, improve multi config resolution algorithm
@bearomorphism
bearomorphism force-pushed the remove-is-empty-config branch from ddadf1b to 2924fae Compare February 3, 2026 15:37
@bearomorphism
bearomorphism enabled auto-merge (squash) February 3, 2026 15:39
@bearomorphism
bearomorphism merged commit 9783d97 into master Feb 3, 2026
20 checks passed
@bearomorphism
bearomorphism deleted the remove-is-empty-config branch February 3, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment