-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Issue #35173] --verbosity quiet suppress success message
#36505
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
Conversation
--verbosity quiet suppress success message--verbosity quiet suppress success message
This will affect ~.2% of test work items
…ld 20231024.9 Microsoft.WindowsDesktop.App.Ref , Microsoft.WindowsDesktop.App.Runtime.win-x64 , VS.Redist.Common.WindowsDesktop.SharedFramework.x64.8.0 , VS.Redist.Common.WindowsDesktop.TargetingPack.x64.8.0 From Version 8.0.0-rtm.23524.7 -> To Version 8.0.0
…net#36467) [release/8.0.1xx] Update dependencies from dotnet/windowsdesktop - Coherency Updates: - Microsoft.NET.Sdk.WindowsDesktop: from 8.0.0-rtm.23524.4 to 8.0.0-rtm.23524.6 (parent: Microsoft.WindowsDesktop.App.Ref)
1a9f694 to
ab89e32
Compare
--verbosity quiet suppress success message--verbosity quiet suppress success message
JL03-Yue
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.
Amazing work! Thanks for your contributions!
| if (_verbosity.IsQuiet()) | ||
| { | ||
| return 0; | ||
| } | ||
| _reporter.WriteLine( | ||
| string.Format( | ||
| LocalizableStrings.InstallationSucceeded, | ||
| string.Join(", ", package.Commands.Select(c => c.Name)), | ||
| package.Id, | ||
| package.Version.ToNormalizedString()).Green()); | ||
| string.Format( | ||
| LocalizableStrings.InstallationSucceeded, | ||
| string.Join(", ", package.Commands.Select(c => c.Name)), | ||
| package.Id, | ||
| package.Version.ToNormalizedString()).Green()); |
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.
if !(_verbosity.IsQuiet())
{
_reporter.WriteLine(
string.Format(
LocalizableStrings.InstallationSucceeded,
string.Join(", ", package.Commands.Select(c => c.Name)),
package.Id,
package.Version.ToNormalizedString()).Green());
}
return 0;
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.
The affirmative condition might be a better choice. Thanks for pointing it out!
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.
I like the if (!_verbosity.IsQuiet()) option better, too. Nice to have just one exit point.
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.
And also (tiny nit) it'd be nice to have one blank line on either side of the if block.
Forgind
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.
Looks good to me!
| q, | ||
| minimal, | ||
| m, | ||
| quiet, |
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.
Can you undo this move? They were previously sorted in order of verbosity, and now they aren't sorted at all.
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.
That's a really good point. I was trying to make minimal the default option. Let me try to find other ways to make it default. Thanks!
| if (_verbosity.IsQuiet()) | ||
| { | ||
| return 0; | ||
| } | ||
| _reporter.WriteLine( | ||
| string.Format( | ||
| LocalizableStrings.InstallationSucceeded, | ||
| string.Join(", ", package.Commands.Select(c => c.Name)), | ||
| package.Id, | ||
| package.Version.ToNormalizedString()).Green()); | ||
| string.Format( | ||
| LocalizableStrings.InstallationSucceeded, | ||
| string.Join(", ", package.Commands.Select(c => c.Name)), | ||
| package.Id, | ||
| package.Version.ToNormalizedString()).Green()); |
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.
I like the if (!_verbosity.IsQuiet()) option better, too. Nice to have just one exit point.
| if (_verbosity.IsQuiet()) | ||
| { | ||
| return 0; | ||
| } | ||
| _reporter.WriteLine( | ||
| string.Format( | ||
| LocalizableStrings.InstallationSucceeded, | ||
| string.Join(", ", package.Commands.Select(c => c.Name)), | ||
| package.Id, | ||
| package.Version.ToNormalizedString()).Green()); | ||
| string.Format( | ||
| LocalizableStrings.InstallationSucceeded, | ||
| string.Join(", ", package.Commands.Select(c => c.Name)), | ||
| package.Id, | ||
| package.Version.ToNormalizedString()).Green()); |
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.
And also (tiny nit) it'd be nice to have one blank line on either side of the if block.
Thank you for your review! Fixed! |
|
Looked at a couple failing legs, and they do seem related to your change. I'm currently leaning towards suggesting that we can just leave the default where it was and have the output change. I think changing the default there changed it for a lot of other commands... Couple failing tests: |
Thanks for the note, and fixed! Yes that's certainly a very good point. It triggers failures in too many other places: leaving the default as it was is a better idea. |
Forgind
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.
I'm happy; thanks for making these changes!
| public void WhenRunWithExactVersionItShouldSucceed() | ||
| { | ||
| ParseResult result = Parser.Instance.Parse($"dotnet tool install -g {PackageId} --version {PackageVersion}"); | ||
| ParseResult result = Parser.Instance.Parse($"dotnet tool install -g {PackageId} --version {PackageVersion} --verbosity minimal"); |
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.
Having reverted the default, do you still need to explicitly set verbosity to minimal in all these tests?
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.
Yes. Because by default verbosity is quiet (first element in the verbosity Enum), which has no output unless there is an error.
|
Thank you for your contribution! |
#35173
Before:
After:
I have edited the

VerbosityOptionas currently the default option isquiet; however, according to the online documentation, the default option should beminimalI know this it
dotnet buildbut they share the sameLoggerVerbositydocumentation.