commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

fix(pre-commit-hooks)!: allow empty ranges in 'commitizen-branch'

Open AdrianDC opened this issue 1 year ago • 4 comments

Description

fix(pre-commit-hooks)!: move 'check' to 'args' for global options

Details: 'args: [...]' is not able to access '-nr NO_RAISE' global arguments for example from a arguments configuration

fix(pre-commit-hooks)!: allow empty ranges in 'commitizen-branch'

Details: Pushing the same history from 'develop' to 'staging' for example fails because range 'origin/HEAD..HEAD' is empty

No commit found with range: 'origin/HEAD..HEAD'

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
  • [x] Test the changes on the local machine manually
  • [ ] Update the documentation for the changes

Expected behavior

Error No commit found with range: 'origin/HEAD..HEAD' not raised

Steps to Test This Pull Request

Push same history to develop then staging

AdrianDC avatar Aug 15 '24 20:08 AdrianDC

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (v4@737c24c). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v4    #1209   +/-   ##
=====================================
  Coverage      ?   97.57%           
=====================================
  Files         ?       55           
  Lines         ?     2516           
  Branches      ?        0           
=====================================
  Hits          ?     2455           
  Misses        ?       61           
  Partials      ?        0           
Flag Coverage Δ
unittests 97.57% <ø> (?)

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 15 '24 20:08 codecov[bot]

Looks good to me. but we probably won't want to bump a major version for it. so I would suggest we remove the ! in all the commits

Lee-W avatar Aug 16 '24 15:08 Lee-W

Thanks for the feedback.

IMO this should be a ! change, as any user having args: [] as I used to will have local and CI breakages.

Could go along other fixes such as #1206 and #1207

Example local usage until released: https://gitlab.com/RadianDevCore/tools/gcil/-/blob/53e6cb534ff77704ac9b9dc51d755b9965556910/.pre-commit-config.yaml#L54

AdrianDC avatar Aug 16 '24 15:08 AdrianDC

If that's the case, we'll need to wait for our next release. @woile we probably can create a v4 branch already?

Lee-W avatar Aug 16 '24 17:08 Lee-W

Just change the base to v4. and let's merge it 🚀

Lee-W avatar Nov 10 '24 02:11 Lee-W