Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.4 KB

GU0002.md

File metadata and controls

50 lines (36 loc) · 1.4 KB

GU0002

The position of a named argument should match

Topic Value
Id GU0002
Severity Hidden
Enabled True
Category Gu.Analyzers.Correctness
Code ArgumentListAnalyzer

Description

The position of a named argument should match parameter position.

Motivation

This is just an OCD-thing. Enable the analyzer if you want named argument's position to match the parameter position.

How to fix violations

Use the code fix.

Configure severity

Via ruleset file.

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

Via #pragma directive.

#pragma warning disable GU0002 // The position of a named argument should match
Code violating the rule here
#pragma warning restore GU0002 // The position of a named argument should match

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

#pragma warning disable GU0002 // The position of a named argument should match

Via attribute [SuppressMessage].

[System.Diagnostics.CodeAnalysis.SuppressMessage("Gu.Analyzers.Correctness", 
    "GU0002:The position of a named argument should match", 
    Justification = "Reason...")]