GU0077

November 24, 2021 ยท View on GitHub

Prefer is null

TopicValue
IdGU0077
SeverityInfo
EnabledTrue
CategoryGu.Analyzers.Correctness
CodeBinaryExpressionAnalyzer

Description

Prefer is null for consistency.

Motivation

ADD MOTIVATION HERE

How to fix violations

ADD HOW TO FIX VIOLATIONS HERE

Configure severity

Via ruleset file.

Configure the severity per project, for more info see MSDN.

Via #pragma directive.

#pragma warning disable GU0077 // Prefer is null
Code violating the rule here
#pragma warning restore GU0077 // Prefer is null

Or put this at the top of the file to disable all instances.

#pragma warning disable GU0077 // Prefer is null

Via attribute [SuppressMessage].

[System.Diagnostics.CodeAnalysis.SuppressMessage("Gu.Analyzers.Correctness", 
    "GU0077:Prefer is null", 
    Justification = "Reason...")]