Skip to content

Shows deprecated warning before prompt questions - #1146

Closed
marcosdotme wants to merge 2 commits into
commitizen-tools:masterfrom
marcosdotme:issue-1135
Closed

Shows deprecated warning before prompt questions#1146
marcosdotme wants to merge 2 commits into
commitizen-tools:masterfrom
marcosdotme:issue-1135

Conversation

@marcosdotme

@marcosdotmemarcosdotme commented May 28, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

Relates to #1135

@codecov

codecovBot commented May 28, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.54%. Comparing base (120d514) to head (22d6d7e).
Report is 526 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 
FlagCoverage Δ
unittests97.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.

@marcosdotmemarcosdotme changed the title Shows deprecated warning after prompt questions to dev, for an better experienceShows deprecated warning after prompt questionsMay 30, 2024
@marcosdotmemarcosdotme changed the title Shows deprecated warning after prompt questionsShows deprecated warning before prompt questionsMay 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`

@Lee-WLee-W left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

Of course. I will add this too

Sign up for freeto 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

@marcosdotme@Lee-W