sapling/.editorconfig
Jun Wu 3768f713e9 Add editorconfig
Summary:
Editorconfig (http://editorconfig.org/) is a file format helping define coding
styles like spaces, tabs etc. It supports a wide range of editors. The upstream
is using it already.

This patch adds a simple .editorconfig, making it clear we use 8-char tabs in
C code, 4-char spaces in Python and Shell scripts, and we don't keep trailing
spaces.

Besides, do a style fixes for `scripts/runcheckcode.sh`. But note that
`scripts/scm-prompt.sh` is left untouched since it was copied from other
repository and we may sync it later.

Test Plan:
Use `gg=G` in vim to format `scripts/runcheckcode.sh` and make sure it does
not showed up in Phabricator with space changes ignored.

Reviewers: #sourcecontrol, durham, ttung

Reviewed By: durham

Subscribers: durham, mjpieters

Differential Revision: https://phabricator.fb.com/D3197242

Signature: t1:3197242:1461129423:e24a898370f8e8eb9bea8be414fee8670f06c16d
2016-04-20 03:05:42 -07:00

14 lines
225 B
INI

# See http://EditorConfig.org for the specification
root = true
[*.{py,sh}]
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
[*.{c,h}]
indent_size = 8
indent_style = tab
trim_trailing_whitespace = true