-
-
Notifications
You must be signed in to change notification settings - Fork 282
fix: ignore invalid tags #1410
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: ignore invalid tags #1410
Conversation
Starting in 4.4.0 due to commitizen-tools#1297 when an invalid tag is present an exception is thrown This commit ignores the invalid tags Follow up from commitizen-tools#1375
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1410 +/- ##
==========================================
+ Coverage 97.33% 97.58% +0.24%
==========================================
Files 42 57 +15
Lines 2104 2687 +583
==========================================
+ Hits 2048 2622 +574
- Misses 56 65 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
I would says silencing exception with try..except..pass
is never a good solution.
The exception was already raised before the PR (it was actually the reason for the PR as it was producing 1 error line by tag). The fact that it's breaking now is an unexpected side-effect which should be fixed, but silencing and ignoring them totally can't be the solution. It allows to see when you make a mistake on the tag or you forget some or when you tag are legitimately invalid (which seem to be your case)
I think there is 3 acceptable solutions:
- fix the regression and make the exception non-breaking with 1 error line by exception
- make an explicit opt-in option to ignore them
- handle the fact that your tags are not valid by:
- using the dedicated
ignored_tag_formats
option to ignore them if you don't want them in your changelog (which given you were intending to silence the exception seem to fit your use case) - using a
version_scheme
in which they are valid if you want them in your changelog
- using the dedicated
I think that fixing the regression is the path to follow (I need to re-read the PR comments to be sure we did not choose to make it breaking given the possibility to explicitly ignore them) but your case should already be already handled by using ignored_tag_formats = ["${major}-${minor}-${patch}-*"]
Issue found and should be fixed by #1418 👍🏼 |
Starting in 4.4.0 due to #1297 when an invalid tag is present an exception is thrown
This commit ignores the invalid tags
Follow up from #1375
Description
Starting in 4.4.0 due to #1297 when an invalid tag is present an exception is thrown
This commit ignores the invalid tags
Follow up from #1375
Checklist
poetry all
locally to ensure this change passes linter check and testExpected behavior
in https://github.com/carlossg/commitizen-test.git the fix changes from
to
Steps to Test This Pull Request
Additional context