-
-
Notifications
You must be signed in to change notification settings - Fork 320
feat(cli): add description when choosing a commit rule #1825
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
feat(cli): add description when choosing a commit rule #1825
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next-release #1825 +/- ##
===============================================
Coverage ? 97.96%
===============================================
Files ? 60
Lines ? 2659
Branches ? 0
===============================================
Hits ? 2605
Misses ? 54
Partials ? 0 ☔ View full report in Codecov by Sentry. |
7b4c8d6 to
aef0171
Compare
commitizen/commands/init.py
Outdated
| return questionary.Choice( | ||
| title=cz_name, value=cz_name, description=f"{first_example}" | ||
| ) | ||
| except Exception: # pylint: disable=broad-except |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick question: what are possible exceptions
the try: block should be as small as possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cz_obj = cz_class(self.config) could cause exception MissingCzCustomizeConfigError for cz_customize, fixed except statement
Lee-W
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, thanks for your contribution. This looks cool! would it be possible for us to add unit test here?
commitizen/commands/init.py
Outdated
| return Path(filename) | ||
|
|
||
| def _ask_name(self) -> str: | ||
| def construct_choice_with_description() -> list[questionary.Choice]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to make it a function inside _ask_name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added unittest for construct_choice_with_description
Closes #1822
Description
This PR adds descriptions to the commit message rule selection step.
Checklist
Was generative AI tooling used to co-author this PR?
Code Changes
uv run poe alllocally to ensure this change passes linter check and testsDocumentation Changes
uv run poe doclocally to ensure the documentation pages renders correctlyExpected Behavior
When selecting the commit rule at
cz init, it should appear a description when selecting a commit rule.Before:

After:

Additional Context
Issue: #1822