-
Notifications
You must be signed in to change notification settings - Fork 113
enable nullable by default #1471
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
Conversation
src/Microsoft.ComponentDetection.Common/DockerReference/DigestUtility.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Common/Utilities/StringUtilities.cs
Outdated
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
The CI build is currently failing due to: |
|
@cataggar if you can rebase this branch, I can review and merge this. |
There was a problem hiding this 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 disabledirectives 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
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
This enabled nullable by default and then adds
#nullable disableanywhere 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 :
3435980 by Copilot in
e9ff160 by Copilot locally.