opentelemetry-dotnet
opentelemetry-dotnet copied to clipboard
Update all projects with `Nullable`, `AnalysisLevel`, and `ImplicitUsings`
This issue is to track the effort of updating all projects to support:
<PropertyGroup>
<Nullable>enable</Nullable>
<AnalysisLevel>latest-All</AnalysisLevel>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
We want these properties in any new projects (https://github.com/open-telemetry/opentelemetry-dotnet/pull/3933#discussion_r1029903850) and it will take some effort to update existing projects.
I'm planning to add these properties to the Common.props, as suggested here: https://github.com/open-telemetry/opentelemetry-dotnet/pull/3924#discussion_r1026975563. This will be on-by-default for all projects. Projects with too many errors can be disabled until updated.
Notes
- AnalysisLevel found 1 error.
- ImplicitUsings found 311 errors.
- Nullable found at least 1526 errors. Likely hundreds more.
- should be able to remove
#nullable enable - need to remove all the
#pragma warning disable IDE0005introduced while fixing ImplicitUsings
Status
- [x]
<Nullable>enable</Nullable> - [ ]
<AnalysisLevel>latest-All</AnalysisLevel>(a lot of issues, it should be enabled per project. When creating PRs consider 2 separate changes - trivial fixes, and more important as separate. It will be easier to review). - [x]
<ImplicitUsings>enable</ImplicitUsings>
Sub Tasks
- #4338
I'm working on removing the ImplicitUsings from projects.
This repo has a lot of shared files which complicates this setting.
I need to remove the ImplicitUsings disable from a few projects at a time and disable the using check in shared *.cs files.
The latest updates for .NET fixed AnalysisLevel, which is now reporting issues. It detected almost 1800 issues in this repo and was blocking PRs. This has been disabled in the Common.props until issues can be resolved.
This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.
Not stale, hopefully it will be done. We have only couple leftovers.