Skip to content

fix(warnings): all warnings should go to stdout #1019

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

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

noirbizarre
Copy link
Member

Description

To be consistent with the build warnings module behavior and to avoid breaking the changelog when using --changelog-to-stdout, all warnings generated with commitizen.out.warn() are printed to stderr

Checklist

  • Add test cases to all the changes you introduce
  • Run ./scripts/format and ./scripts/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes (N/A)

Expected behavior

Whatever the warning raised during a bump or a changelog command, they should be printed to stderr.
More especially, when you are trying to run one of the above command with --changelog-to-stdout and your repository have some tags not matching the tag pattern, changelog should not be mixed with repeated InvalidVersion GitTag('not-a-version', 'sha1', 'yyyy-mm-dd') statements.

Steps to Test This Pull Request

Add a git tag not matching the tag_format to your repository.
Run the cz bump --changelog-to-stdout --git-output-to-stderr > CHANGELOG.md command.
CHANGELOG.md should only contain the changelog.
Same when using the commitizen-action, invalid tags should not appear in the changelog increment file.

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.49%. Comparing base (120d514) to head (5ecdb50).
Report is 210 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1019      +/-   ##
==========================================
+ Coverage   97.33%   97.49%   +0.15%     
==========================================
  Files          42       55      +13     
  Lines        2104     2395     +291     
==========================================
+ Hits         2048     2335     +287     
- Misses         56       60       +4     
Flag Coverage Δ
unittests 97.49% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@woile woile merged commit 61b1570 into commitizen-tools:master Mar 11, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants