From: Michael Stefaniuc Subject: Re: [PATCH v2] Add .editorconfig file Message-Id: <57a68cba-718a-1d33-d550-9cacafdc6f8c@winehq.org> Date: Thu, 13 Dec 2018 20:52:37 +0100 In-Reply-To: References: <3912802.ognrodplc7@arch> <20181212091444.24829-1-eb1@sil.org> <7c9cc8d2-f5f9-ee22-5a05-b108e6ff83d3@winehq.org> Hello Eberhard, On 12/13/18 9:03 AM, Eberhard Beilharz wrote: > 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. cool, no objections from my side then. > 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. Yeah, we didn't have a good vim versus emacs flamewar in a good while ;) Not many new developers use those this days. 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 >>> > >