Disabling the NotNull attribute

Hello,

As of the last few versions or so of Rider, using null-checks in Rider causes an automatic reference to Jetbrains.Annotations and adds the [NotNull] attribute to parameters and fields. This breaks our team coding standards, so I always end up needing to manually remove it. Is there a way to disable this in settings? Toggling every seemingly related setting did nothing.

3 comments
Comment actions Permalink

Hello Eric,

 

You can disable addition of [NotNull] attribute by disabling Automatically propagate annotations option located under Settings -> Editor -> Inspection Settings -> Code Annotations

 

Let me know if this helps.

1
Comment actions Permalink

Worked perfectly! Thanks!

0
Comment actions Permalink

Thank you for the update. I'm glad it helped!

 

If you have any questions in the future, do not hesitate to contact us again.

1

Please sign in to leave a comment.