Title: Fix deprecated precommit by timsu92 · Pull Request #1569 · commitizen-tools/commitizen · GitHub
Open Graph Title: Fix deprecated precommit by timsu92 · Pull Request #1569 · commitizen-tools/commitizen
X Title: Fix deprecated precommit by timsu92 · Pull Request #1569 · commitizen-tools/commitizen
Description: Description cz init modifies .pre-commit-config.yaml in a deprecated way. This PR fixes that, however, pre-commit must be upgraded to v3.2.0 onwards. Currently, commitizen is writing something like this to .pre-commit-config.yaml: - hooks: - id: commitizen - id: commitizen-branch stages: - push repo: https://github.com/commitizen-tools/commitizen rev: v4.8.3 However, pre-commit will complaint that it's deprecated like mentioned in #1560 . The upstream modification was proposed in pre-commit/pre-commit#2732, and fixed in pre-commit/pre-commit#2808 That means, "pre-push" starts to be usable in v3.2.0, while "push" starts to be deprecated. This changed has already been stated in https://github.com/commitizen-tools/commitizen/blob/master/docs/README.md?plain=1#L209 Consequently, these modifications were made: Change from "push" stage to "pre-push" stage Disallow old pre-commit to be used both in this project and when used by other projects Update test Checklist I have read the contributing guidelines Code Changes Add test cases to all the changes you introduce Run poetry all locally to ensure this change passes linter check and tests Manually test the changes: Verify the feature/bug fix works as expected in real-world scenarios Test edge cases and error conditions Ensure backward compatibility is maintained Document any manual testing steps performed Update the documentation for the changes Documentation Changes Run poetry doc locally to ensure the documentation pages renders correctly Check and fix any broken links (internal or external) in the documentation When running poetry doc, any broken internal documentation links will be reported in the console output like this: INFO - Doc file 'config.md' contains a link 'commands/bump.md#-post_bump_hooks', but the doc 'commands/bump.md' does not contain an anchor '#-post_bump_hooks'. Expected Behavior See commitizen generates config like this: - hooks: - id: commitizen - id: commitizen-branch stages: - pre-push repo: https://github.com/commitizen-tools/commitizen rev: v4.8.3 Steps to Test This Pull Request cz init Enable both pre-commit hooks Additional Context Close #1560
Open Graph Description: Description cz init modifies .pre-commit-config.yaml in a deprecated way. This PR fixes that, however, pre-commit must be upgraded to v3.2.0 onwards. Currently, commitizen is writing something like...
X Description: Description cz init modifies .pre-commit-config.yaml in a deprecated way. This PR fixes that, however, pre-commit must be upgraded to v3.2.0 onwards. Currently, commitizen is writing something like...
Opengraph URL: https://github.com/commitizen-tools/commitizen/pull/1569
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:78c80a8c-eb81-e9ff-e003-97666b8cf7ea |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A340:39A6E:60B90A:864230:6A57D6CA |
| html-safe-nonce | 71f2a3b3b17d420b0dc5ac0d61e0dfb5c74a0452acf809542bd032d7c7980a04 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzQwOjM5QTZFOjYwQjkwQTo4NjQyMzA6NkE1N0Q2Q0EiLCJ2aXNpdG9yX2lkIjoiMjAyMzg3NDYzNzAzNDE0OTU3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 618bddda73d58429de3e6a0c7721018dcbf949419a35d93a7dfdec2571b5c214 |
| hovercard-subject-tag | pull_request:2724516310 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/commitizen-tools/commitizen/pull/1569/files |
| twitter:image | https://avatars.githubusercontent.com/u/33785401?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/33785401?s=400&v=4 |
| og:image:alt | Description cz init modifies .pre-commit-config.yaml in a deprecated way. This PR fixes that, however, pre-commit must be upgraded to v3.2.0 onwards. Currently, commitizen is writing something like... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 837767abbd14b05f219fd812ef2842c659968b63619e1b966dded83972ab5bca |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git |
| octolytics-dimension-user_id | 62252524 |
| octolytics-dimension-user_login | commitizen-tools |
| octolytics-dimension-repository_id | 106127589 |
| octolytics-dimension-repository_nwo | commitizen-tools/commitizen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 106127589 |
| octolytics-dimension-repository_network_root_nwo | commitizen-tools/commitizen |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9044d0f867aa9892268d1f430238ff123e11ee91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width