Add an .editorconfig file
authorTobias Brunner <tobias@strongswan.org>
Fri, 6 Jul 2018 12:07:55 +0000 (14:07 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 22 Aug 2019 13:18:06 +0000 (15:18 +0200)
It's currently not possible to configure our indentation scheme for
continuation lines (i.e. use 1-3 spaces to align with the upper line).
There is an issue open regarding this, see [1].  So we can't run e.g.
eclint over our codebase to detect issues without getting a lot of
false positives.

The main trigger was that this sets the preferred tab width in GitHub's
code browser.

[1] https://github.com/editorconfig/editorconfig/issues/323

References #3111.

.editorconfig [new file with mode: 0644]

diff --git a/.editorconfig b/.editorconfig
new file mode 100644 (file)
index 0000000..944b24b
--- /dev/null
@@ -0,0 +1,54 @@
+# http://editorconfig.org
+
+root = true
+
+[*]
+charset = utf-8
+# for alignment reasons the last tab may be replaced with < indent_size spaces,
+# which we currently can't configure here
+indent_style = tab
+indent_size = 4
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+block_comment_start = /*
+block_comment = *
+block_comment_end = */
+
+# don't change these files
+[{doc/**,src/include/{linux,sys}/**,testing/{hosts,tests}/**,AUTHORS,COPYING}]
+charset = unset
+indent_style = unset
+indent_size = unset
+end_of_line = unset
+insert_final_newline = unset
+trim_trailing_whitespace = unset
+
+# never trim whitespace in patches, everything else should not be changed
+[*.patch]
+trim_trailing_whitespace = false
+charset = unset
+indent_style = unset
+indent_size = unset
+end_of_line = unset
+insert_final_newline = unset
+
+[{.*,NEWS,README,INSTALL,*.{gemspec.in,pod,rb,ui}}]
+indent_style = space
+indent_size = 2
+
+[*.{gpr,adb,ads}]
+indent_style = space
+indent_size = 3
+line_comment = --
+
+[{*.{md,gradle,xml},HACKING}]
+indent_style = space
+indent_size = 4
+
+[src/libcharon/plugins/vici/README.md]
+indent_style = tab
+
+[src/libcharon/plugins/vici/**/*.{rst,PL,pm,py}]
+indent_style = space
+indent_size = 4