Skip to content

Add nullable annotations to NuGet.DependencyResolver.Core - #7642

Merged
zivkan merged 6 commits into
devfrom
dev-zivkan-nullable-DependencyResolver
Sep 2, 2026
Merged

zivkan merged 6 commits into
devfrom
dev-zivkan-nullable-DependencyResolver

Conversation

@zivkan

@zivkan zivkan commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#15060

Description

Removes #nullable disable from all files in NuGet.DependencyResolver.Core, and fixes build errors. Minor changes to some public APIs were made to make to make nullable checks more correct. In particular, making some properties required, so they don't need to be nullable.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests N/A
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. N/A

@nkolev92 nkolev92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good. I think it's largely 1 pattern that should be fixed.

i thought I had made the skill favor required, but it seems like I only did it for private/internal types and these are public.
https://github.com/NuGet/NuGet.Client/blob/dev/.agents/skills/nullable-enablement/SKILL.md#annotation-philosophy-prefer-non-null

Honestly, public are fine to, but at the discretion of us, rather than automatically for all.

@zivkan
zivkan marked this pull request as ready for review August 25, 2026 09:57
@zivkan
zivkan requested a review from a team as a code owner August 25, 2026 09:57

@nkolev92 nkolev92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some minor comments.

@zivkan
zivkan force-pushed the dev-zivkan-nullable-DependencyResolver branch from 8694b0b to dab71dc Compare August 29, 2026 01:48
@zivkan
zivkan requested a review from nkolev92 August 29, 2026 01:48

@nkolev92 nkolev92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor comments.

This one has honestly been a pretty tricky annotation since we do so many operations where we have not enforced null.

@zivkan
zivkan requested a review from nkolev92 September 1, 2026 07:12
@zivkan
zivkan merged commit e6aaa9a into dev Sep 2, 2026
18 checks passed
@zivkan
zivkan deleted the dev-zivkan-nullable-DependencyResolver branch September 2, 2026 02:14
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.

Add nullable annotations to NuGet.DependencyResolver.Core

3 participants