Skip to content

Conversation

@cataggar
Copy link
Member

@cataggar cataggar commented Oct 14, 2025

This enabled nullable by default and then adds #nullable disable anywhere it is needed in the current code. This will help ensure new code uses nullable and allows existing code to move to it incrementally. This follows the official guidance for moving to nullable.

Incremental step for

Following step 2 in https://learn.microsoft.com/en-us/dotnet/csharp/nullable-migration-strategies :

Nullable enable as the default: Set this default when you're actively developing new features. You want all new code to benefit from nullable reference types and nullable static analysis. Using this default means you must add a #nullable disable to the top of each file. You'll remove these preprocessor directives as you address the warnings in each file.

3435980 by Copilot in

e9ff160 by Copilot locally.

@codecov
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.2%. Comparing base (02e9dbd) to head (bd7d049).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1471   +/-   ##
=====================================
  Coverage   90.2%   90.2%           
=====================================
  Files        423     423           
  Lines      35452   35452           
  Branches    2207    2207           
=====================================
+ Hits       31996   31997    +1     
  Misses      3001    3001           
+ Partials     455     454    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cataggar cataggar marked this pull request as ready for review October 14, 2025 22:52
@cataggar cataggar requested a review from a team as a code owner October 14, 2025 22:52
@cataggar
Copy link
Member Author

The CI build is currently failing due to:

@JamieMagee
Copy link
Member

@cataggar if you can rebase this branch, I can review and merge this.

Copilot AI review requested due to automatic review settings November 18, 2025 22:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables nullable reference types by default across the entire codebase and adds #nullable disable directives to existing files that are not yet nullable-compliant. This follows the official Microsoft guidance for incremental nullable migration, allowing new code to benefit from nullable analysis while existing code can be migrated gradually.

Key changes:

  • Enabled nullable reference types globally in Directory.Build.props
  • Added #nullable disable directives to all existing source files to maintain current behavior
  • Configured IDE diagnostics to treat redundant/unnecessary nullable directives as suggestions

Reviewed Changes

Copilot reviewed 299 out of 404 changed files in this pull request and generated no comments.

File Description
Directory.Build.props Adds <Nullable>enable</Nullable> property to enable nullable by default
.editorconfig Configures IDE0240 and IDE0241 diagnostics for nullable directive redundancy
All test files Adds #nullable disable directive to preserve existing behavior during incremental migration
All source files Adds #nullable disable directive to preserve existing behavior during incremental migration
Files not reviewed (1)
  • src/Microsoft.ComponentDetection.Common/Resources.Designer.cs: Language not supported

@JamieMagee JamieMagee merged commit 3b0671c into microsoft:main Nov 19, 2025
28 checks passed
@github-actions
Copy link

👋 Hi! It looks like you modified some files in the Detectors folder.
You may need to bump the detector versions if any of the following scenarios apply:

  • The detector detects more or fewer components than before
  • The detector generates different parent/child graph relationships than before
  • The detector generates different devDependencies values than before

If none of the above scenarios apply, feel free to ignore this comment 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants