stride3d / stride3d/stride

Annotate with nullable attributes

Open
#2,155 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Epic priority-Low work-estimate-XL
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Is your feature request related to a problem? Please describe.
Currently the nullable feature is not enabled on most projects. Instead we have some old custom attributes (such as [NoNull]) that are implemented in Stride.Core. These attributes are compatible with Resharper but are ignored by the actual .NET analyzers.

Describe the solution you'd like
Annotate our code with attributes from https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis. Then gradually enable the nullable feature on projects.

Describe alternatives you've considered
None. It can be really useful to detect issues and is expected in modern codebase.

Additional context
It will likely result in lots of warnings. To reduce overload, we can start with the editor and assets assemblies and then the core assemblies. Later apply to the remaining engine assemblies.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing custom attributes in Stride.Core and the editor and assets assemblies identified as the first targets. Compare them with the System.Diagnostics.CodeAnalysis attributes, then assess the warnings produced when nullable analysis is enabled. Done means the selected assemblies are annotated and nullable warnings are reduced before expanding to the core and remaining engine assemblies.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.