From: Eberhard Beilharz Subject: Re: [PATCH v2] Add .editorconfig file Message-Id: Date: Thu, 13 Dec 2018 09:03:25 +0100 In-Reply-To: <7c9cc8d2-f5f9-ee22-5a05-b108e6ff83d3@winehq.org> References: <3912802.ognrodplc7@arch> <20181212091444.24829-1-eb1@sil.org> <7c9cc8d2-f5f9-ee22-5a05-b108e6ff83d3@winehq.org> Hi Michael, Thanks for your review! Michael Stefaniuc  wrote on 2018-12-12 at 21:28 +0100: > Hello Eberhard, > > tab_width needs to be 8. That's a given. Done. > For exiting code the style of the surrounding code trumps. So the indent > and line length settings are just the recommendations for new code but > not necessary true for all files in Wine. > > The important question though is: > What will the editors / IDE do with this file? > Will they automatically start to re-indent the whole file being edited > if they see .editorconfig? > That would be counterproductive as unrelated whitespace changes are not > allowed. Of course fixing whitespace issues in modified lines is wanted > and sometimes even expected, depending on the subsystem maintainer. From my experience there is no difference in having a .editorconfig file vs. settings in the IDE: if you don't have a .editorconfig file you have to configure your IDE so that it doesn't reformat the whole file, or be careful when you commit your change that you don't introduce unwanted whitespace changes. The same is true with a .editorconfig file. In all the editors and IDEs that I've seen so far you have the option to configure if the editor/IDE should use the .editorconfig at all, and if it should apply the settings to the entire file or only to new/modified code. The big advantage of having a .editorconfig file IMO is that a) it documents the desired settings in machine readable form, and b) it allows occasional or first-time contributors to use the correct settings without having to reconfigure the IDE each time you switch between different projects. Regards,     Eberhard > > bye > michael > > > On 12/12/18 10:14 AM, Eberhard Beilharz wrote: >> This allows editors and IDEs to automatically adjust settings to >> the coding style prefered by Wine (cf. https://editorconfig.org/). >> >> Signed-off-by: Eberhard Beilharz >> --- >> .editorconfig | 11 +++++++++++ >> 1 file changed, 11 insertions(+) >> create mode 100644 .editorconfig >> >> diff --git a/.editorconfig b/.editorconfig >> new file mode 100644 >> index 0000000000..71dc8633f8 >> --- /dev/null >> +++ b/.editorconfig >> @@ -0,0 +1,11 @@ >> +root = true >> + >> +# Defaults >> +[*] >> +indent_style = space >> +indent_size = 4 >> +tab_width = 4 >> +charset = utf-8 >> +trim_trailing_whitespace = true >> +insert_final_newline = false >> +max_line_length = 100 >>
Hi Michael,

Thanks for your review!

Michael Stefaniuc <mstefani@winehq.org> wrote on 2018-12-12 at 21:28 +0100:
Hello Eberhard,

tab_width needs to be 8. That's a given.
Done.
For exiting code the style of the surrounding code trumps. So the indent
and line length settings are just the recommendations for new code but
not necessary true for all files in Wine.

The important question though is:
What will the editors / IDE do with this file?
Will they automatically start to re-indent the whole file being edited
if they see .editorconfig?
That would be counterproductive as unrelated whitespace changes are not
allowed. Of course fixing whitespace issues in modified lines is wanted
and sometimes even expected, depending on the subsystem maintainer.

From my experience there is no difference in having a .editorconfig file vs. settings in the IDE: if you don't have a .editorconfig file you have to configure your IDE so that it doesn't reformat the whole file, or be careful when you commit your change that you don't introduce unwanted whitespace changes.

The same is true with a .editorconfig file. In all the editors and IDEs that I've seen so far you have the option to configure if the editor/IDE should use the .editorconfig at all, and if it should apply the settings to the entire file or only to new/modified code.

The big advantage of having a .editorconfig file IMO is that a) it documents the desired settings in machine readable form, and b) it allows occasional or first-time contributors to use the correct settings without having to reconfigure the IDE each time you switch between different projects.

Regards,
    Eberhard


bye
	michael


On 12/12/18 10:14 AM, Eberhard Beilharz wrote:
This allows editors and IDEs to automatically adjust settings to
the coding style prefered by Wine (cf. https://editorconfig.org/).

Signed-off-by: Eberhard Beilharz <eb1@sil.org>
---
 .editorconfig | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 .editorconfig

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..71dc8633f8
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,11 @@
+root = true
+
+# Defaults
+[*]
+indent_style = space
+indent_size = 4
+tab_width = 4
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = false
+max_line_length = 100