Skip to content

Instantly share code, notes, and snippets.

@NN---
Forked from cezarypiatek/.editorconfig
Last active February 21, 2023 15:03
Show Gist options
  • Save NN---/06555e0d8b0da9878e8aa6f7509af286 to your computer and use it in GitHub Desktop.
Save NN---/06555e0d8b0da9878e8aa6f7509af286 to your computer and use it in GitHub Desktop.
This snippet set severity level to error for different rules related to the reference nullability
[*.cs]
# Dereference of a possibly null reference.
dotnet_diagnostic.CS8602.severity = error
# Object or collection initializer implicitly dereferences possibly null member.
dotnet_diagnostic.CS8670.severity = error
# Possible null reference assignment.
dotnet_diagnostic.CS8601.severity = error
# Unboxing a possibly null value.
dotnet_diagnostic.CS8605.severity = error
# Possible null reference return.
dotnet_diagnostic.CS8603.severity = error
# Possible null reference argument for parameter.
dotnet_diagnostic.CS8604.severity = error
# Converting null literal or possible null value to non-nullable type.
dotnet_diagnostic.CS8600.severity = error
# Thrown value may be null.
dotnet_diagnostic.CS8597.severity = error
# Cannot convert null literal to non-nullable reference type.
dotnet_diagnostic.CS8625.severity = error
# Nullable value type may be null.
dotnet_diagnostic.CS8629.severity = error
# Non-nullable variable must contain a non-null value when exiting constructor. Consider declaring it as nullable.
dotnet_diagnostic.CS8618.severity = error
# Parameter must have a non-null value when exiting.
dotnet_diagnostic.CS8762.severity = error
# Nullability of reference types in value doesn't match target type.
dotnet_diagnostic.CS8619.severity = error
# Nullability of reference types in return type doesn't match the target delegate (possibly because of nullability attributes).
dotnet_diagnostic.CS8621.severity = error
# Nullability of reference types in type of parameter doesn't match the target delegate (possibly because of nullability attributes).
dotnet_diagnostic.CS8622.severity = error
# The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match constraint type.
dotnet_diagnostic.CS8631.severity = error
# The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'class' constraint.
dotnet_diagnostic.CS8634.severity = error
# The type cannot be used as type parameter in the generic type or method. Nullability of type argument doesn't match 'notnull' constraint.
dotnet_diagnostic.CS8714.severity = error
# Nullability of reference types in type doesn't match overridden member.
dotnet_diagnostic.CS8608.severity = error
# Nullability of reference types in return type doesn't match overridden member.
dotnet_diagnostic.CS8609.severity = error
# Nullability of reference types in return type doesn't match partial method declaration.
dotnet_diagnostic.CS8819.severity = error
# Nullability of reference types in type parameter doesn't match overridden member.
dotnet_diagnostic.CS8610.severity = error
# Nullability of reference types in type parameter doesn't match partial method declaration.
dotnet_diagnostic.CS8611.severity = error
# Nullability of reference types in type doesn't match implicitly implemented member.
dotnet_diagnostic.CS8612.severity = error
# Nullability of reference types in return type doesn't match implicitly implemented member.
dotnet_diagnostic.CS8613.severity = error
# Nullability of reference types in type of parameter doesn't match implicitly implemented member.
dotnet_diagnostic.CS8614.severity = error
# Nullability of reference types in type doesn't match implemented member.
dotnet_diagnostic.CS8615.severity = error
# Nullability of reference types in return type doesn't match implemented member.
dotnet_diagnostic.CS8616.severity = error
# Nullability of reference types in type of parameter doesn't match implemented member.
dotnet_diagnostic.CS8617.severity = error
# Nullability in constraints for type parameter of method doesn't match the constraints for type parameter of interface method. Consider using an explicit interface implementation instead.
dotnet_diagnostic.CS8633.severity = error
# Nullability of reference types in explicit interface specifier doesn't match interface implemented by the type.
dotnet_diagnostic.CS8643.severity = error
# Type does not implement interface member. Nullability of reference types in interface implemented by the base type doesn't match.
dotnet_diagnostic.CS8644.severity = error
# Argument cannot be used for parameter due to differences in the nullability of reference types.
dotnet_diagnostic.CS8620.severity = error
# Argument cannot be used as an output due to differences in the nullability of reference types.
dotnet_diagnostic.CS8624.severity = error
# Member is already listed in the interface list on type with different nullability of reference types.
dotnet_diagnostic.CS8645.severity = error
# Partial method declarations have inconsistent nullability in constraints for type parameter.
dotnet_diagnostic.CS8667.severity = error
# Nullability of return type doesn't match overridden member (possibly because of nullability attributes).
dotnet_diagnostic.CS8764.severity = error
# Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).
dotnet_diagnostic.CS8765.severity = error
# Nullability of reference types in return type doesn't match implemented member (possibly because of nullability attributes).
dotnet_diagnostic.CS8768.severity = error
# Nullability of reference types in type of parameter of doesn't match implicitly implemented member (possibly because of nullability attributes).
dotnet_diagnostic.CS8767.severity = error
# Nullability of reference types in return type of doesn't match implicitly implemented member (possibly because of nullability attributes).
dotnet_diagnostic.CS8766.severity = error
# Nullability of reference types in type of parameter doesn't match implemented member (possibly because of nullability attributes).
dotnet_diagnostic.CS8769.severity = error
# A possible null value may not be used for a type marked with [NotNull] or [DisallowNull]
dotnet_diagnostic.CS8607.severity = error
# A method marked [DoesNotReturn] should not return.
dotnet_diagnostic.CS8763.severity = error
# Method lacks [DoesNotReturn] annotation to match implemented or overridden member.
dotnet_diagnostic.CS8770.severity = error
# Member must have a non-null value when exiting.
dotnet_diagnostic.CS8774.severity = error
# Member cannot be used in this attribute.
dotnet_diagnostic.CS8776.severity = error
# Member must have a non-null value when exiting.
dotnet_diagnostic.CS8775.severity = error
# Parameter must have a non-null value when exiting.
dotnet_diagnostic.CS8777.severity = error
# Parameter must have a non-null value when exiting because parameter is non-null.
dotnet_diagnostic.CS8824.severity = error
# Return value must be non-null because parameter is non-null.
dotnet_diagnostic.CS8825.severity = error
# The switch expression does not handle some null inputs (it is not exhaustive).
dotnet_diagnostic.CS8655.severity = error
# The switch expression does not handle some null inputs (it is not exhaustive). However, a pattern with a 'when' clause might successfully match this value.
dotnet_diagnostic.CS8847.severity = error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment