Skip to content
This repository was archived by the owner on Apr 10, 2021. It is now read-only.

EditorConfig Rule Evaluation

Andre Greeff edited this page Jul 27, 2015 · 2 revisions

Indentation

This page is by no means intended to replace the official EditorConfig documentation, however there are a few key points with combinations of specific rules that your should be aware of.

For a full listing of all valid properties, please check the official EditorConfig properties list wiki page.

Indentation with tabs

Either of the following two rulesets will indent code with a tab width of 4 characters:

Ruleset 1:

indent_style = tab
tab_width = 4

Ruleset 2:

indent_style = tab
indent_size = 4

Note: The tab_width property relies on the indent_style = tab property.

Indentation with spaces

Because indent_style defaults to space, all three of the following rulesets are considered valid.

Ruleset 1:

Will indent code with 2 space characters:

indent_style = space
indent_size = 2

Ruleset 2:

Will indent code with 4 space characters:

tab_width = 4

Ruleset 3:

Will indent code with 8 space characters:

indent_size = 8

Note: Even though the indent_style property defaults to space, it is recommended to set these explicitly in your rulesets. This will remove any ambiguity with regards to how the code will be formatted.

Clone this wiki locally