Skip to content

Commit 4a7b8ec

Browse files
authored
Remove nullable disable warnings (#48846)
1 parent bf4223b commit 4a7b8ec

File tree

64 files changed

+96
-185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+96
-185
lines changed

src/Cli/dotnet/CommandFactory/CommandSpec.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable warnings
5-
64
using Microsoft.DotNet.Cli.CommandFactory.CommandResolution;
75

86
namespace Microsoft.DotNet.Cli.CommandFactory;
97

108
public class CommandSpec(
11-
string? path,
9+
string path,
1210
string? args,
13-
Dictionary<string, string> environmentVariables = null)
11+
Dictionary<string, string>? environmentVariables = null)
1412
{
1513
public string Path { get; } = path;
1614

17-
public string Args { get; } = args;
15+
public string? Args { get; } = args;
1816

1917
public Dictionary<string, string> EnvironmentVariables { get; } = environmentVariables ?? [];
2018

src/Cli/dotnet/Commands/New/DotnetCommandCallbacks.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable warnings
5-
64
using Microsoft.DotNet.Cli.Commands.Hidden.Add;
75
using Microsoft.DotNet.Cli.Commands.Package.Add;
86
using Microsoft.DotNet.Cli.Commands.Reference.Add;

src/Cli/dotnet/Commands/New/MSBuildEvaluation/CapabilityExpressionEvaluator.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable warnings
5-
64
namespace Microsoft.DotNet.Cli.Commands.New.MSBuildEvaluation;
75

86
/// <remarks>

src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable warnings
5-
64
using MSBuildProject = Microsoft.Build.Evaluation.Project;
75

86
namespace Microsoft.DotNet.Cli.Commands.New.MSBuildEvaluation;

src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluator.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable warnings
5-
64
using System.Diagnostics;
75
using Microsoft.Build.Evaluation;
86
using Microsoft.DotNet.Cli.Utils;
@@ -197,7 +195,7 @@ private MSBuildEvaluationResult EvaluateProjectInternal(IEngineEnvironmentSettin
197195
targetFrameworksString = Sha256Hasher.HashWithNormalizedCasing(targetFramework);
198196
}
199197

200-
Dictionary<string, string> properties = new()
198+
Dictionary<string, string?> properties = new()
201199
{
202200
{ "ProjectPath", Sha256Hasher.HashWithNormalizedCasing(projectPath)},
203201
{ "SdkStyleProject", IsSdkStyleProject.ToString() },

src/Cli/dotnet/Commands/New/MSBuildEvaluation/MultiTargetEvaluationResult.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable warnings
5-
64
using MSBuildProject = Microsoft.Build.Evaluation.Project;
75

86
namespace Microsoft.DotNet.Cli.Commands.New.MSBuildEvaluation;

src/Cli/dotnet/Commands/New/MSBuildEvaluation/NonSDKStyleEvaluationResult.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable warnings
5-
64
using MSBuildProject = Microsoft.Build.Evaluation.Project;
75

86
namespace Microsoft.DotNet.Cli.Commands.New.MSBuildEvaluation;

src/Cli/dotnet/Commands/New/MSBuildEvaluation/ProjectCapabilityConstraint.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable warnings
5-
64
using Microsoft.Build.Evaluation;
75
using Microsoft.Extensions.Logging;
86
using Microsoft.TemplateEngine.Abstractions;

src/Cli/dotnet/Commands/New/MSBuildEvaluation/ProjectContextSymbolSource.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable warnings
5-
64
using Microsoft.Extensions.Logging;
75
using Microsoft.TemplateEngine.Abstractions;
86
using Microsoft.TemplateEngine.Abstractions.Components;

src/Cli/dotnet/Commands/New/NewCommandParser.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable warnings
5-
64
using System.CommandLine;
75
using System.CommandLine.Parsing;
86
using Microsoft.DotNet.Cli.Commands.New.MSBuildEvaluation;
@@ -170,7 +168,7 @@ private static CliTemplateEngineHost CreateHost(
170168
{ "prefs:language", preferredLang },
171169
{ "dotnet-cli-version", Product.Version },
172170
{ "RuntimeFrameworkVersion", new Muxer().SharedFxVersion },
173-
{ "NetStandardImplicitPackageVersion", new FrameworkDependencyFile().GetNetStandardLibraryVersion() },
171+
{ "NetStandardImplicitPackageVersion", new FrameworkDependencyFile().GetNetStandardLibraryVersion() ?? "" },
174172
};
175173
return new CliTemplateEngineHost(
176174
HostIdentifier,

0 commit comments

Comments
 (0)