Skip to content

Commit 5457ad3

Browse files
authored
Unify the nullable reference type approaches (#48776)
1 parent 016005f commit 5457ad3

File tree

660 files changed

+1297
-41
lines changed

Some content is hidden

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

660 files changed

+1297
-41
lines changed

Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
We still check $(TargetFrameworks) for empty though, because for single-targeted builds we want to
1010
allow nullable warnings regardless of target framework.
1111
-->
12-
<NoWarn Condition="'$(DisableNullableWarnings)' == '' AND '$(TargetFrameworks)' != '' AND '$(TargetFramework)' != '' AND '$(TargetFrameworkIdentifier)' != '.NETCoreApp'">$(NoWarn);Nullable</NoWarn>
12+
<NoWarn Condition="'$(TargetFrameworks)' != '' AND '$(TargetFramework)' != '' AND '$(TargetFrameworkIdentifier)' != '.NETCoreApp'">$(NoWarn);Nullable</NoWarn>
1313
</PropertyGroup>
1414

1515
<ItemGroup>

src/BuiltInTools/HotReloadAgent.Data/Microsoft.DotNet.HotReload.Agent.Data.Package.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<GenerateDocumentationFile>false</GenerateDocumentationFile>
88
<DebugType>none</DebugType>
99
<GenerateDependencyFile>false</GenerateDependencyFile>
10-
<Nullable>enable</Nullable>
1110
<LangVersion>preview</LangVersion>
1211

1312
<!-- NuGet -->

src/BuiltInTools/HotReloadAgent.PipeRpc/Microsoft.DotNet.HotReload.Agent.PipeRpc.Package.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<GenerateDocumentationFile>false</GenerateDocumentationFile>
88
<DebugType>none</DebugType>
99
<GenerateDependencyFile>false</GenerateDependencyFile>
10-
<Nullable>enable</Nullable>
1110
<LangVersion>preview</LangVersion>
1211

1312
<!-- NuGet -->

src/BuiltInTools/HotReloadAgent/Microsoft.DotNet.HotReload.Agent.Package.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<GenerateDocumentationFile>false</GenerateDocumentationFile>
99
<DebugType>none</DebugType>
1010
<GenerateDependencyFile>false</GenerateDependencyFile>
11-
<Nullable>enable</Nullable>
1211
<LangVersion>preview</LangVersion>
1312

1413
<!-- NuGet -->

src/Cli/dotnet/AspNetCoreCertificateGenerator.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Configurer;
57

68
namespace Microsoft.DotNet.Cli;

src/Cli/dotnet/AutomaticEncodingRestorer.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using System.Security;
57

68
namespace Microsoft.DotNet.Cli;

src/Cli/dotnet/BuildServer/BuildServerException.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
namespace Microsoft.DotNet.Cli.BuildServer;
57

68
internal class BuildServerException : Exception

src/Cli/dotnet/BuildServer/BuildServerProvider.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57
using Microsoft.DotNet.Cli.Utils.Extensions;
68
using Microsoft.DotNet.Configurer;

src/Cli/dotnet/BuildServer/IBuildServer.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
namespace Microsoft.DotNet.Cli.BuildServer;
57

68
internal interface IBuildServer

src/Cli/dotnet/BuildServer/IBuildServerProvider.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
namespace Microsoft.DotNet.Cli.BuildServer;
57

68
[Flags]

src/Cli/dotnet/BuildServer/MSBuildServer.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.Build.Execution;
57

68
namespace Microsoft.DotNet.Cli.BuildServer;

src/Cli/dotnet/BuildServer/RazorPidFile.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.Extensions.EnvironmentAbstractions;
57

68
namespace Microsoft.DotNet.Cli.BuildServer;

src/Cli/dotnet/BuildServer/RazorServer.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.CommandFactory;
57
using Microsoft.Extensions.EnvironmentAbstractions;
68

src/Cli/dotnet/BuildServer/VBCSCompilerServer.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using System.Reflection;
57
using Microsoft.DotNet.Cli.CommandFactory;
68
using Microsoft.DotNet.Cli.Utils;

src/Cli/dotnet/BundledTargetFramework.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using System.Reflection;
57
using System.Runtime.Versioning;
68
using NuGet.Frameworks;

src/Cli/dotnet/CliCompletion.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using System.CommandLine.Completions;
57
using Microsoft.Build.Evaluation;
68
using Microsoft.DotNet.Cli.Utils;

src/Cli/dotnet/CliTransaction.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
namespace Microsoft.DotNet.Cli;
57

68
internal interface ITransactionContext

src/Cli/dotnet/CliUsage.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Commands;
57

68
namespace Microsoft.DotNet.Cli;

src/Cli/dotnet/CommandBase.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using System.CommandLine;
57
using Microsoft.DotNet.Cli.Extensions;
68

src/Cli/dotnet/CommandDirectoryContext.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
namespace Microsoft.DotNet.Cli;
57

68
internal static class CommandDirectoryContext

src/Cli/dotnet/CommandFactory/CommandFactory.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57
using NuGet.Frameworks;
68

src/Cli/dotnet/CommandFactory/CommandFactoryUsingResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using System.Diagnostics;
57
using Microsoft.DotNet.Cli.CommandFactory.CommandResolution;
68
using Microsoft.DotNet.Cli.Utils;

src/Cli/dotnet/CommandFactory/CommandResolution/AbstractPathBasedCommandResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57
using Microsoft.DotNet.Cli.Utils.Extensions;
68

src/Cli/dotnet/CommandFactory/CommandResolution/AppBaseCommandResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57

68
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;

src/Cli/dotnet/CommandFactory/CommandResolution/AppBaseDllCommandResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57
using Microsoft.DotNet.Cli.Utils.Extensions;
68

src/Cli/dotnet/CommandFactory/CommandResolution/CommandResolverArguments.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using NuGet.Frameworks;
57

68
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;

src/Cli/dotnet/CommandFactory/CommandResolution/CompositeCommandResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57

68
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;

src/Cli/dotnet/CommandFactory/CommandResolution/DefaultCommandResolverPolicy.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57

68
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;

src/Cli/dotnet/CommandFactory/CommandResolution/DepsJsonCommandResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57
using Microsoft.DotNet.Cli.Utils.Extensions;
68
using Microsoft.Extensions.DependencyModel;

src/Cli/dotnet/CommandFactory/CommandResolution/DotnetToolsCommandResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;
57

68
public class DotnetToolsCommandResolver : ICommandResolver

src/Cli/dotnet/CommandFactory/CommandResolution/GenericPlatformCommandSpecFactory.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57

68
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;

src/Cli/dotnet/CommandFactory/CommandResolution/ICommandResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;
57

68
public interface ICommandResolver

src/Cli/dotnet/CommandFactory/CommandResolution/ICommandResolverPolicy.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;
57

68
public interface ICommandResolverPolicy

src/Cli/dotnet/CommandFactory/CommandResolution/IPackagedCommandSpecFactory.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using NuGet.ProjectModel;
57

68
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;

src/Cli/dotnet/CommandFactory/CommandResolution/IPlatformCommandSpecFactory.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57

68
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;

src/Cli/dotnet/CommandFactory/CommandResolution/IProject.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using NuGet.Frameworks;
57
using NuGet.ProjectModel;
68

src/Cli/dotnet/CommandFactory/CommandResolution/IPublishedPathCommandSpecFactory.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;
57

68
public interface IPublishedPathCommandSpecFactory

src/Cli/dotnet/CommandFactory/CommandResolution/LocalToolsCommandResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.ToolManifest;
57
using Microsoft.DotNet.Cli.ToolPackage;
68
using Microsoft.DotNet.Cli.Utils;

src/Cli/dotnet/CommandFactory/CommandResolution/LockFileTargetExtensions.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using NuGet.Packaging.Core;
57
using NuGet.ProjectModel;
68

src/Cli/dotnet/CommandFactory/CommandResolution/MSBuildProject.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.Build.Evaluation;
57
using Microsoft.DotNet.Cli.Utils;
68
using Microsoft.DotNet.Cli.Utils.Extensions;

src/Cli/dotnet/CommandFactory/CommandResolution/MuxerCommandResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57
using Microsoft.DotNet.Cli.Utils.Extensions;
68

src/Cli/dotnet/CommandFactory/CommandResolution/MuxerCommandSpecMaker.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57

68
namespace Microsoft.DotNet.Cli.CommandFactory.CommandResolution;

src/Cli/dotnet/CommandFactory/CommandResolution/NuGetUtils.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using NuGet.Packaging.Core;
57
using NuGet.ProjectModel;
68

src/Cli/dotnet/CommandFactory/CommandResolution/OutputPathCommandResolver.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
5+
46
using Microsoft.DotNet.Cli.Utils;
57
using Microsoft.DotNet.Cli.Utils.Extensions;
68
using NuGet.Frameworks;

0 commit comments

Comments
 (0)