Title: Add type annotations for the arguments of the CLI entry point · Issue #1477 · commitizen-tools/commitizen · GitHub
Open Graph Title: Add type annotations for the arguments of the CLI entry point · Issue #1477 · commitizen-tools/commitizen
X Title: Add type annotations for the arguments of the CLI entry point · Issue #1477 · commitizen-tools/commitizen
Description: Description In the CLI entry point (cli.py), all properties inside args are unknown to the IDE, which makes it harder for new developers to read and understand the code. This is especially problematic when trying to quickly identify whic...
Open Graph Description: Description In the CLI entry point (cli.py), all properties inside args are unknown to the IDE, which makes it harder for new developers to read and understand the code. This is especially problema...
X Description: Description In the CLI entry point (cli.py), all properties inside args are unknown to the IDE, which makes it harder for new developers to read and understand the code. This is especially problema...
Opengraph URL: https://github.com/commitizen-tools/commitizen/issues/1477
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add type annotations for the arguments of the CLI entry point","articleBody":"### Description\n\nIn the CLI entry point (`cli.py`), all properties inside `args` are unknown to the IDE, which makes it harder for new developers to read and understand the code.\n\nThis is especially problematic when trying to quickly identify which function `args.func` actually refers to.\n\n### Possible Solution\n\nI suggest adding type hints to clarify which attributes correspond to which functions. Since this change only involves adding type annotations, it will not affect the end-user's runtime behavior. In theory, such a change is safe.\n\n\n### Additional context\n\nI suggest adding the following content.\n\n```py\nclass Args(argparse.Namespace):\n config: str | None = None\n debug: bool = False\n name: str | None = None\n no_raise: str | None = None\n report: bool = False\n project: bool = False\n commitizen: bool = False\n verbose: bool = False\n func: type[\n commands.Init # init\n | commands.Commit # commit (c)\n | commands.ListCz # ls\n | commands.Example # example\n | commands.Info # info\n | commands.Schema # schema\n | commands.Bump # bump\n | commands.Changelog # changelog (ch)\n | commands.Check # check\n | commands.Version # version\n ]\n```\n\n### Additional context\n\n_No response_","author":{"url":"https://github.com/gbaian10","@type":"Person","name":"gbaian10"},"datePublished":"2025-05-31T02:55:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1477/commitizen/issues/1477"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b75ef316-a6d1-fc0b-e41f-0726c1b60f4d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E070:B97C3:38704F4:4DD32DC:6A4F3DA1 |
| html-safe-nonce | 7d6325a2472bb3ff384ecc51191fa92aea9d1afd6e8ae254e98382887794c712 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDcwOkI5N0MzOjM4NzA0RjQ6NEREMzJEQzo2QTRGM0RBMSIsInZpc2l0b3JfaWQiOiI2OTYxMDEyMTI4NzMyODg4NDgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0e17396bc2c6071fe0db8a32137ac0ae8fe62dcd8b404d223e16c2b373d060c5 |
| hovercard-subject-tag | issue:3104719302 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/commitizen-tools/commitizen/1477/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a58cdd02696994ee699406facf66054860842c7c967dfa2943bfe70dc3e0ce25/commitizen-tools/commitizen/issues/1477 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a58cdd02696994ee699406facf66054860842c7c967dfa2943bfe70dc3e0ce25/commitizen-tools/commitizen/issues/1477 |
| og:image:alt | Description In the CLI entry point (cli.py), all properties inside args are unknown to the IDE, which makes it harder for new developers to read and understand the code. This is especially problema... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gbaian10 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width