From 68346b6962c21dc3a30a01405cc926b1e0fdf45e Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 6 Jul 2018 14:07:55 +0200 Subject: [PATCH] Add an .editorconfig file 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 | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..944b24b6f --- /dev/null +++ b/.editorconfig @@ -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