Skip to content

Instantly share code, notes, and snippets.

@ffes
Last active May 5, 2018 10:07
Show Gist options
  • Save ffes/f950ced199ea6392589c4616c02c6be9 to your computer and use it in GitHub Desktop.
Save ffes/f950ced199ea6392589c4616c02c6be9 to your computer and use it in GitHub Desktop.
EditorConfig following coding standards and convensions

Coding Standards and Conventions

Some intro text...

Snippets

Python

Based on https://www.python.org/dev/peps/pep-0008/

[*.py]
indent_style = space
indent_size = 4

Java

Based on http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html

[*.java]
indent_size = 8

C#

Based on https://msdn.microsoft.com/en-us/library/ff926074.aspx

[*.cs]
indent_style = space
indent_size = 4

JavaScript

Based on https://www.w3schools.com/js/js_conventions.asp

[*.js]
indent_style = space
indent_size = 4

Make

Requirement (link needed)

[{Makefile,*.mak}]
indent_style = tab

YAML

Requirement (link needed)

[*.yml]
indent_style = space

package.json

(link needed)

[package.json]
indent_style = space
indent_size = 2

Visual Studio Project Files

(Not officially documented as far as I am aware) List of extensions incomplete

[{*.{csproj,vcxproj,vcxproj.user}}]
indent_size = 2
indent_style = space
insert_final_newline = false
end_of_line = crlf
@MAPJe71
Copy link

MAPJe71 commented Mar 22, 2017

Excerpt of YAML spec v1.2 Chapter 6, Paragraph 1

In YAML block styles, structure is determined by indentation. In general, indentation is defined as a zero or more space characters at the start of a line.

To maintain portability, tab characters must not be used in indentation, since different systems treat tabs differently. Note that most modern editors may be configured so that pressing the tab key results in the insertion of an appropriate number of spaces.

The amount of indentation is a presentation detail and must not be used to convey content information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment