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

Embracing the null #45421

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ public CommandResult Execute(Action<Process>? processStarted)

if (CommandLoggingContext.IsVerbose)
{
Debug.Assert(sw is not null);
var message = string.Format(
LocalizableStrings.ProcessExitedWithCode,
FormatProcessInfo(_process.StartInfo),
exitCode,
sw?.ElapsedMilliseconds);
sw.ElapsedMilliseconds);
if (exitCode == 0)
{
Reporter.Verbose.WriteLine(message.Green());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<!-- Avoid https://github.com/dotnet/arcade/issues/9305 -->
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
<Nullable>enable</Nullable>
<NoWarn Condition="'$(TargetFramework)' == 'net472'">$(NoWarn);Nullable</NoWarn>
Copy link
Member Author

Choose a reason for hiding this comment

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

When multi-targeting between net472 or netstandard2.0 and anything else, disable null checking on those TF. Otherwise you end up with non-sense warnings.

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we fix this in a more central location so it applies to all projects and not just cli util?

Seems like I could just chagne my logic here that's DisableNullableWarnings to a NoWarn addition: https://github.com/dotnet/sdk/pull/45420/files#diff-50e91c82311ea26f2a73202525dfdf2b0a89c178ee666b2bf3ad4c84ac4c06dc

Copy link
Member Author

Choose a reason for hiding this comment

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

That is fine by me, I was just trying to demonstrate the way to approach this. Did small scale for that.

</PropertyGroup>

<ItemGroup>
Expand Down
Loading