浏览代码

Add .editorconfig file

A .editorconfig file allows many editors (e.g. Visual Studio Code)
to autoconfigure themselves based on its contents. This avoids
some formatting issues in PRs because editors will do the right
thing by default with a .editorconfig file available in the repo.
Daan De Meyer 4 年之前
父节点
当前提交
8c14c6bd0b
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 10 0
      .editorconfig
  2. 1 0
      .gitattributes

+ 10 - 0
.editorconfig

@@ -0,0 +1,10 @@
+root = true
+
+[*]
+charset = utf-8
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[{CMakeLists.txt,*.cmake,*.rst}]
+indent_size = 2
+indent_style = space

+ 1 - 0
.gitattributes

@@ -1,5 +1,6 @@
 .git*            export-ignore
 .git*            export-ignore
 .hooks*          export-ignore
 .hooks*          export-ignore
+.editorconfig    export-ignore
 
 
 # Custom attribute to mark sources as using our C code style.
 # Custom attribute to mark sources as using our C code style.
 [attr]our-c-style  whitespace=tab-in-indent  format.clang-format-6.0
 [attr]our-c-style  whitespace=tab-in-indent  format.clang-format-6.0