-
-
Notifications
You must be signed in to change notification settings - Fork 310
fix(config): add warning for multiple configuration files and update documentation #1773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(config): add warning for multiple configuration files and update documentation #1773
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1773 +/- ##
==========================================
+ Coverage 97.88% 97.93% +0.04%
==========================================
Files 60 60
Lines 2606 2611 +5
==========================================
+ Hits 2551 2557 +6
+ Misses 55 54 -1 ☔ View full report in Codecov by Sentry. |
Detects when multiple configuration files exist (excluding pyproject.toml) and displays a warning message identifying which file is being used. Closes commitizen-tools#1771
2489068 to
c03d500
Compare
Remove extra steps to check if config files are empty. Just warn about multiple files and show first file from the list.
bearomorphism
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great but need some refactoring
|
Could you add the expected behavior in the PR description? Thanks! |
I just updated the PR with the expected behavior (sorry about that, completely forgot to add that part), and also refactored my code with the suggestions that you all gave. If I missed anything, let me know again. |
@nicoleman0 you're doing it great! But the pipeline is failing because some of the commit messages does not follow the requirements. Could you fix the commit messages? Thanks! |
Co-authored-by: Wei Lee <[email protected]>
Co-authored-by: Tim Hsiung <[email protected]>
Co-authored-by: Tim Hsiung <[email protected]>
…efactor read_cfg function
d3154d4 to
f0fc425
Compare
@bearomorphism I believe I've fixed the generic commit messages and I also refactored the The redundant |
Description
This PR implements a warning system that detects when multiple configuration files exist in the project directory (excluding
pyproject.toml) and displays a warning message identifying which file is being used.The implementation follows the consensus from issue #1702 where maintainers agreed that "we should have one and only one configuration file" and decided to add a warning when multiple config files are detected.
Checklist
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsDocumentation Changes
uv run poe doclocally to ensure the documentation pages renders correctlyExpected Behavior
When multiple configuration files are detected (e.g.,
.cz.tomland.cz.json), commitizen will display a warning message like:Multiple config files detected: .cz.toml, .cz.json. Using config file: '.cz.toml'.pyproject.toml)--configflag, no warning is displayedpyproject.tomlplus one other), no warning is displayedFixes #1771