Skip to content

Commit 902ccf9

Browse files
committed
improve editorconfig
* add default configuration * add specified configuration for YAML and Go
1 parent 43fd436 commit 902ccf9

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.editorconfig

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1-
[*.{md,markdown}]
1+
# Top-most EditorConfig file
2+
root = true
3+
4+
# Every file should according to these default configurations if not specified
5+
[*]
6+
# Use UNIX-style line endings
7+
end_of_line = LF
8+
# Use utf-8 file encoding
9+
charset = utf-8
10+
# 4 space indent
11+
indent_style = space
12+
indent_size = 4
13+
# Ensure file ends with a newline when saving(prevent `no newline at EOF`)
14+
insert_final_newline = true
15+
# Remove any whitespace characters preceding newline characters
216
trim_trailing_whitespace = true
317

18+
# For YAML
19+
[*.{yml,yaml}]
20+
indent_size = 2
21+
22+
# For Go files
23+
[*.go]
24+
# `gofmt` uses tabs for indentation
25+
indent_style = tab

0 commit comments

Comments
 (0)