Title: feat: add an argument to limit the length of commit message by kevin1kevin1k · Pull Request #1076 · commitizen-tools/commitizen · GitHub
Open Graph Title: feat: add an argument to limit the length of commit message by kevin1kevin1k · Pull Request #1076 · commitizen-tools/commitizen
X Title: feat: add an argument to limit the length of commit message by kevin1kevin1k · Pull Request #1076 · commitizen-tools/commitizen
Description: Description Re-opened another PR for #191 as the long-hanging #557 has been closed. Check if the length of commit message exceeds the specified limit. The limit can be specified via, for example, -l 72 or --message-length-limit 72. 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 Expected behavior If one runs cz commit -l/--message-length-limit N, the commit would fail (with the exception CommitMessageLengthExceededError) when the message is longer than N characters. Note that for ConventionalCommitsCz, the limit applies only from the prefix to the subject. In other words, everything after the first line (the body and the footer) are not counted in the length. Steps to Test This Pull Request poetry run python commitizen/cli.py -n cz_conventional_commits c -l 10 (or cz -n cz_conventional_commits c -l 10 when merged) ENTER (type of change is fix: with length 5) ENTER (no scope) type 123456 with length 6 ENTER (no body) ENTER (not breaking change) ENTER (no footer) As 5+6 = 11 > 10 the process should exit with message Length of commit message exceeds limit (11/10) and error code 32. Additional context Closes: #191
Open Graph Description: Description Re-opened another PR for #191 as the long-hanging #557 has been closed. Check if the length of commit message exceeds the specified limit. The limit can be specified via, for example, ...
X Description: Description Re-opened another PR for #191 as the long-hanging #557 has been closed. Check if the length of commit message exceeds the specified limit. The limit can be specified via, for example, ...
Opengraph URL: https://github.com/commitizen-tools/commitizen/pull/1076
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2026b561-65d4-70d4-2b7a-fb7f7e6a8533 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B4A8:1EE5:17E6BE8:22460BC:6A4FBF61 |
| html-safe-nonce | c0195da1d0488124edfce7506de2193cdae4fb55fe7ab5975639aa0e5ec200c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNEE4OjFFRTU6MTdFNkJFODoyMjQ2MEJDOjZBNEZCRjYxIiwidmlzaXRvcl9pZCI6IjQzMzMwMzkyMTkzMzUyMTY5OTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 963c57a31d787b20ed6a321db800101f419a4529cb628fff43b83c48eeb79920 |
| hovercard-subject-tag | pull_request:1833230378 |
| 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/1076/files |
| twitter:image | https://avatars.githubusercontent.com/u/9023838?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/9023838?s=400&v=4 |
| og:image:alt | Description Re-opened another PR for #191 as the long-hanging #557 has been closed. Check if the length of commit message exceeds the specified limit. The limit can be specified via, for example, ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d8f8209b188a80e19a6957836ab9229715797be5db1a04163963c674ccc33f6 |
| 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 | ea848e83cf3bf3613dd7b13d52965a684fd23ec5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width