Skip to content

feat: add --no-raise to avoid raising error codes #489

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 5 commits into from
Apr 15, 2022
Merged

Conversation

woile
Copy link
Member

@woile woile commented Mar 4, 2022

Closes #485

Description

Checklist

  • Add test cases to all the changes you introduce
  • Run ./script/format and ./script/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

Expected behavior

Exit code would rise 0 instead.

Steps to Test This Pull Request

With no new commit run

cz --no-raise 3 bump

For more than one:

cz -nr 3 -nr 4 bump

Additional context

  • First implementation is just for numbers
  • Docs should be updated
  • It should support also a configuration parameter

@woile woile force-pushed the feat/485-no-raise branch 2 times, most recently from 9cc174e to f3a8769 Compare March 4, 2022 13:34
@codecov
Copy link

codecov bot commented Mar 4, 2022

Codecov Report

Merging #489 (8c2a6f4) into master (bc9be40) will decrease coverage by 0.20%.
The diff coverage is 96.00%.

@@            Coverage Diff             @@
##           master     #489      +/-   ##
==========================================
- Coverage   98.05%   97.85%   -0.21%     
==========================================
  Files          39       39              
  Lines        1441     1539      +98     
==========================================
+ Hits         1413     1506      +93     
- Misses         28       33       +5     
Flag Coverage Δ
unittests 97.85% <96.00%> (-0.21%) ⬇️

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

Impacted Files Coverage Δ
commitizen/cli.py 93.93% <89.28%> (-3.68%) ⬇️
commitizen/commands/changelog.py 96.59% <95.45%> (-0.82%) ⬇️
commitizen/changelog.py 96.70% <97.56%> (+0.22%) ⬆️
commitizen/__version__.py 100.00% <100.00%> (ø)
commitizen/bump.py 100.00% <100.00%> (ø)
commitizen/commands/bump.py 95.19% <100.00%> (ø)
commitizen/cz/__init__.py 100.00% <100.00%> (ø)
commitizen/cz/customize/customize.py 95.08% <100.00%> (+0.85%) ⬆️
commitizen/defaults.py 100.00% <100.00%> (ø)
commitizen/exceptions.py 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 605b125...8c2a6f4. Read the comment docs.

Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update documentation for it? How will the argument usage look like?

@woile
Copy link
Member Author

woile commented Mar 29, 2022

@Lee-W I'm wondering whether we should go for:

cz -nr 1 -nr 2 bump

or

cz -nr 1,2,3 bump

I think for github action would be easier to do the 2nd one and maybe it's simpler. What do you think?

@Lee-W
Copy link
Member

Lee-W commented Mar 29, 2022

I like cz -nr 1,2,3 bump a bit more 👍

@woile woile force-pushed the feat/485-no-raise branch from f3a8769 to a521af0 Compare April 1, 2022 15:10
@woile
Copy link
Member Author

woile commented Apr 1, 2022

Updated docs and now it works with:

cz -nr 1,2,3
cz -nr NO_INCREMENT,NO_COMMITS_FOUND

Please test 🙏🏻

@woile woile force-pushed the feat/485-no-raise branch from a521af0 to cfaea2c Compare April 1, 2022 15:15
@woile woile requested a review from Lee-W April 1, 2022 21:24
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward seeing it landing 🤩🤩🤩 just some minor suggestions / questions, but feel free to merge it 💯

| InvalidCommandArgumentError | 18 | The argument provide to command is invalid (e.g. `cz check -commit-msg-file filename --rev-range master..`) |
| InvalidConfigurationError | 19 | An error was found in the Commitizen Configuration, such as duplicates in `change_type_order` |
| NotAllowed | 20 | `--incremental` cannot be combined with a `rev_range` |
| NoneIncrementExit | 21 | The commits found are not elegible to be bumped |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is neat!

@woile woile force-pushed the feat/485-no-raise branch from b6cb867 to 8c2a6f4 Compare April 8, 2022 22:48
@woile
Copy link
Member Author

woile commented Apr 8, 2022

Now it sohuld be ready

@woile woile requested a review from Lee-W April 10, 2022 18:18
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@woile woile merged commit 1570947 into master Apr 15, 2022
@woile woile deleted the feat/485-no-raise branch April 15, 2022 12:15
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.

enable skiping certain errors like no commit found
2 participants