Skip to content

Commit 0172c58

Browse files
Remove redundant #nullable disable from 153 files (#13157)
### Context Projects have `<Nullable>enable</Nullable>` at the project level, but many files retain legacy `#nullable disable` directives. Files that are already nullable-clean don't need the directive. ### Changes Made Removed `#nullable disable` from files verified to build without nullable warnings: | Project | Cleaned | Remaining | |---------|---------|-----------| | Utilities | 5 | 21 | | Build | 79 | 284 | | MSBuild | 2 | 11 | | Tasks | 41 | 86 | | Shared | 26 | 75 | | **Total** | **153** | **477** | **Shared folder** required full repo builds since files compile into multiple projects. Files retained the directive when: - Nullable warnings present in any TFM (net472, net10.0) - Interface files (changing nullability affects implementors) - Exception classes (signatures affect other code) - Public API methods called from non-nullable contexts ### Testing - Each project built individually with 0 warnings - Full repo build: 0 warnings, 0 errors - Fixed double blank lines left by directive removal ### Notes None <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com> Co-authored-by: Rainer Sigwald <raines@microsoft.com>
1 parent c1d5007 commit 0172c58

174 files changed

Lines changed: 0 additions & 289 deletions

File tree

Some content is hidden

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

src/Build/BackEnd/Components/BuildRequestEngine/BuildRequestConfigurationResponse.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
5-
64
namespace Microsoft.Build.BackEnd
75
{
86
/// <summary>

src/Build/BackEnd/Components/Caching/RegisteredTaskObjectCache.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
using Microsoft.Build.Framework;
66
using Microsoft.Build.Shared;
77

8-
#nullable disable
9-
108
namespace Microsoft.Build.BackEnd.Components.Caching
119
{
1210
/// <summary>

src/Build/BackEnd/Components/Caching/ResultsCacheWithOverride.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66
using Microsoft.Build.BackEnd;
77
using Microsoft.Build.Shared;
88

9-
#nullable disable
10-
119
namespace Microsoft.Build.Execution
1210
{
1311
internal class ResultsCacheWithOverride : IResultsCache
1412
{
1513
private readonly IResultsCache _override;
1614
public ResultsCache CurrentCache { get; }
1715

18-
1916
public ResultsCacheWithOverride(IResultsCache @override)
2017
{
2118
_override = @override;

src/Build/BackEnd/Components/Communications/NodeInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
using Microsoft.Build.Execution;
77

8-
#nullable disable
9-
108
namespace Microsoft.Build.BackEnd
119
{
1210
/// <summary>

src/Build/BackEnd/Components/Logging/BuildLoggingContext.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.Build.Framework;
77
using Microsoft.Build.Shared;
88

9-
#nullable disable
10-
119
namespace Microsoft.Build.BackEnd.Logging
1210
{
1311
/// <summary>

src/Build/BackEnd/Components/Logging/EvaluationLoggingContext.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
using Microsoft.Build.Framework.Profiler;
99
using Microsoft.Build.Shared;
1010

11-
#nullable disable
12-
1311
namespace Microsoft.Build.BackEnd.Components.Logging
1412
{
1513
/// <summary>

src/Build/BackEnd/Components/Logging/EventRedirectorToSink.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using Microsoft.Build.Framework;
55
using Microsoft.Build.Shared;
66

7-
#nullable disable
8-
97
namespace Microsoft.Build.BackEnd.Logging
108
{
119
/// <summary>

src/Build/BackEnd/Components/Logging/ForwardingLoggerRecord.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using Microsoft.Build.Framework;
55
using Microsoft.Build.Shared;
66

7-
#nullable disable
8-
97
namespace Microsoft.Build.Logging
108
{
119
/// <summary>

src/Build/BackEnd/Components/Logging/LoggingServiceFactory.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
using Microsoft.Build.Shared;
55

6-
#nullable disable
7-
86
namespace Microsoft.Build.BackEnd.Logging
97
{
108
/// <summary>

src/Build/BackEnd/Components/Scheduler/ScheduleTimeRecord.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using System;
55
using Microsoft.Build.Shared;
66

7-
#nullable disable
8-
97
namespace Microsoft.Build.BackEnd
108
{
119
/// <summary>

0 commit comments

Comments
 (0)