From 11cd41d92242dce7392ae5ace49ce61413a01677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Mon, 14 Mar 2016 14:40:06 +0000 Subject: [PATCH] Add EditorConfig reference to README.developer Change-Id: I595e94bd0274e3ee3c1d8764fc6c93f28993c30f Reviewed-on: https://code.wireshark.org/review/14468 Reviewed-by: Alexis La Goutte Reviewed-by: Michael Mann Reviewed-by: Pascal Quantin --- doc/README.developer | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/doc/README.developer b/doc/README.developer index b98c6fe23c..1cdc41f8c1 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -667,12 +667,29 @@ discussion of tabs, spaces, and indentation, see http://www.jwz.org/doc/tabs-vs-spaces.html -When creating a new file, you are free to choose an indentation logic. -Most of the files in Wireshark tend to use 2-space or 4-space -indentation. You are encouraged to write a short comment on the -indentation logic at the beginning of this new files. The -tabs-vs-spaces document above provides examples of Emacs and vi -modelines for this purpose. +Most of the files in Wireshark tend to use 2-space or 4-space indentation. When +creating a new file you are free to choose an indentation logic but you are +encouraged to use 4-space indentation for C/C++ source to keep inconsistency +between files to a minimum. + +Each file should have a short comment (modelines) on the indentation logic at +the end of the file. See + + https://www.wireshark.org/tools/modelines.html + +for guidance. + +A complementary and arguably better alternative to modelines is +EditorConfig (http://editorconfig.org). The default EditorConfig indentation +style is defined in the .editorconfig file placed on the root of the project +source code tree (4-space indentation for C). One advantage of following the +default style is that no additional EditorConfig settings are required for new +files. If your file does not follow this style please add a file-specific +setting overriding the default style to a separate .editorconfig configuration +file placed in the source file directory. + +Some IDEs and text editors have built-in EditorConfig support and many more +have plugins available (links at http://editorconfig.org). Please do not leave trailing whitespace (spaces/tabs) on lines.