Skip to content
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

Shows deprecated warning before prompt questions #1146

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

marcosdotme
Copy link
Contributor

@marcosdotme marcosdotme commented May 28, 2024

Description

Shows deprecated warning before prompt questions to dev, for an better experience.

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 (deprecated warning already in docs)

Screenshots

Shows deprecated warning before prompt questions

image

Shows deprecated warning on command help text

image

Dont' shows deprecated warning if uses --signoff option the right way

image

@marcosdotme
Copy link
Contributor Author

Relates to #1135

Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.54%. Comparing base (120d514) to head (22d6d7e).
Report is 352 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1146      +/-   ##
==========================================
+ Coverage   97.33%   97.54%   +0.20%     
==========================================
  Files          42       55      +13     
  Lines        2104     2486     +382     
==========================================
+ Hits         2048     2425     +377     
- Misses         56       61       +5     
Flag Coverage Δ
unittests 97.54% <100.00%> (+0.20%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marcosdotme marcosdotme changed the title Shows deprecated warning after prompt questions to dev, for an better experience Shows deprecated warning after prompt questions May 30, 2024
@marcosdotme marcosdotme changed the title Shows deprecated warning after prompt questions Shows deprecated warning before prompt questions May 30, 2024
It's a bad dev experience getting warning/failures after all questions
answered.
The deprecated text was not shown when `cz commit --help`
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible for us to also document the -- behavior in help text 🤔

Comment on lines +81 to +83
retry: bool = self.arguments.get("retry")
no_retry: bool = self.arguments.get("no_retry")
retry_after_failure: bool = self.config.settings.get("retry_after_failure")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a default value to these get?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, we can add a explicit default value but .get has a default value to None if not specified.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, but None is not a bool, False would be better 🙂

out.warn(
"signoff mechanic is deprecated, please use `cz commit -- -s` instead.\n"
)
extra_args = self.arguments.get("extra_cli_args", "--") + " -s"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use f-string here

@marcosdotme
Copy link
Contributor Author

Would it be possible for us to also document the -- behavior in help text 🤔

Of course. I will add this too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants