Navigation:  StyleCop 4.3 > StyleCop 4.3 Rules > Spacing Rules >

SA1027: TabsMustNotBeUsed

Previous pageReturn to chapter overview
StyleCop 4.3

Send comments on this topic.

SA1027: TabsMustNotBeUsed

Glossary Item Box

TypeName
TabsMustNotBeUsed

CheckId

SA1027

Category

Spacing Rules

 

Cause

The C# code contains a tab character.

Rule Description

A violation of this rule occurs whenever the code contains a tab character.

Tabs should not be used within C# code, because the length of the tab character can vary depending upon the editor being used to view the code. This can cause the spacing and indexing of the code to vary from the developer’s original intention, and can in some cases make the code difficult to read.

For these reasons, tabs should not be used, and each level of indentation should consist of four spaces. This will ensure that the code looks the same no matter which editor is being used to view the code.

How to Fix Violations

To fix a violation of this rule, remove the tab character from the code.

 


© Microsoft Corporation. All Rights Reserved.