-
-
Notifications
You must be signed in to change notification settings - Fork 992
Port JetBrains' nullability annotations and clean-up code. #2018
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
Might be some overlap between this and #2012. |
Yeah, I noticed it after opening this PR, not the first time it happens. 😂 Since mine is bigger and more comprehensive, I recommend to merge it first, and leave the .NET 6 porting work to you. |
@adamsitnik I synched the PR with the changes #2012 brought. Can you take a look? |
@adamsitnik friendly reminder. It's getting conflicts. |
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.
The nullability annotations look very good, I wonder how many warnings we get right now? cc @AndreyAkinshin who introduced the JetBrains annotations
When it comes to adding .NET Standard 2.1 target, I am against as in 3 weeks net6.0
will the oldest officially supported .NET Standard 2.1 runtime and we already target net6.0
.
Thank you for your contribution @teo-tsirpanis !
src/BenchmarkDotNet/Toolchains/InProcess.NoEmit/BenchmarkActionFactory_Base.cs
Show resolved
Hide resolved
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.
I like it!
@adamsitnik once we agree on the set of target frameworks, we can merge it.
Please wait before merging, I have to change the title and description, and add a couple more changes I thought. |
It matches the BCL name.
It matches the BCL name.
common.props: <EnableNETAnalyzers>true</EnableNETAnalyzers>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> |
@YegorStepanov these warnings were already enabled but with the obsolete |
@teo-tsirpanis @adamsitnik all of our CI builds are red now. Here is the error:
|
I will send a PR soon |
@AndreyAkinshin @YegorStepanov appologies for breaking the build, thanks for fixing it! |
The code looks pretty messy now: I changed to Is there a simple way to suppress them all? If @teo-tsirpanis isn't working on it, I will be happy to do it (~4 months). |
I set it to |
The project was using
JetBrains.Annotations
' nullability annotations that predate C# 8.0's nullability annotations. I enabled<Nullable>annotations</Nullable>
, removed[JetBrains.Annotations.NotNullAttribute]
, and replaced[JetBrains.Annotations.CanBeNull]
with?
. Entirely annotating the project is a much bigger undertaking which is left for another time.I also cleaned-up other parts of the code.