From 9b5b8e5bad550ded361948d457b230821f47681f Mon Sep 17 00:00:00 2001 From: juga0 Date: Sun, 3 Jun 2018 10:44:02 +0000 Subject: [PATCH 1/2] Add .editorconfig to follow coding standards style --- .editorconfig | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..27ed90fafd --- /dev/null +++ b/.editorconfig @@ -0,0 +1,33 @@ +# this should work for all editors that support .editorconfig! +# +# on debian, emacs users should install elpa-editorconfig and vim +# users should install vim-editorconfig. + +root = true + +[*] +indent_style = space +# this remove final newline in some editors, instead of inserting it +# insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = lf +charset = utf-8 +max_line_length = 79 + +[*.py] +indent_size = 4 +# to do not have final newline in python code +insert_final_newline = true + +[*.c, *.h] +# done in tests and other cases do not use 2 spaces identations, so this +# should be commented on those cases +indent_size = 2 +trim_trailing_whitespace = true + +[Makefile, *.am] +indent_style = tab + +[*-spec.txt] +# specs seem to have 76 chars max per lines as RFCs +max_line_length = 76 \ No newline at end of file From cc09ff253e2516ea3bc4bdd7fa8c6052b36900e6 Mon Sep 17 00:00:00 2001 From: juga0 Date: Mon, 11 Jun 2018 21:29:40 +0000 Subject: [PATCH 2/2] Add explanation about editorconf in coding standards so that developers know what is .editorconfig for. --- doc/HACKING/CodingStandards.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/HACKING/CodingStandards.md b/doc/HACKING/CodingStandards.md index 3711f70198..4a8f13716b 100644 --- a/doc/HACKING/CodingStandards.md +++ b/doc/HACKING/CodingStandards.md @@ -185,6 +185,9 @@ deviations from our C whitespace style. Generally, we use: `puts (x)`. - Function declarations at the start of the line. +If you use an editor that has plugins for editorconfig.org, the file +`.editorconfig` will help you to conform this coding style. + We try hard to build without warnings everywhere. In particular, if you're using gcc, you should invoke the configure script with the option `--enable-fatal-warnings`. This will tell the compiler