Rediger

Del via


Formatting rule (IDE0055)

Property Value
Rule ID IDE0055
Title Formatting rule
Category Style
Subcategory N/A
Applicable languages C# and Visual Basic

All formatting options have rule ID IDE0055 and title Fix formatting. These formatting options affect how indentation, spaces, and new lines are aligned around .NET programming language constructs. The options fall into the following categories and are documented on separate pages:

  • .NET formatting options

    Options that apply to both C# and Visual Basic. The EditorConfig names for these options start with the dotnet_ prefix.

  • C# formatting options

    Options that are specific to the C# language. The EditorConfig names for these options start with the csharp_ prefix.

When you set the severity of code-style rule IDE0055, it applies to all the formatting options. To set the severity of a formatting rule violation, add the following setting to a configuration file.

dotnet_diagnostic.IDE0055.severity = <severity value>

The severity value must be warning or error to be enforced on build. For all possible severity values, see severity level.

For more information about configuring options, see Option format.

Suppress a warning

If you want to suppress only a single violation, add preprocessor directives to your source file to disable and then re-enable the rule.

#pragma warning disable IDE0055
// The code that's violating the rule is on this line.
#pragma warning restore IDE0055

To disable the rule for a file, folder, or project, set its severity to none in the configuration file.

[*.{cs,vb}]
dotnet_diagnostic.IDE0055.severity = none

To disable all of the code-style rules, set the severity for the category Style to none in the configuration file.

[*.{cs,vb}]
dotnet_analyzer_diagnostic.category-Style.severity = none

For more information, see How to suppress code analysis warnings.

See also