On 6/12/23 17:15, Eelco Chaudron wrote: > > > On 12 Jun 2023, at 17:07, Mike Pattrick wrote: > >> On Mon, Jun 12, 2023 at 10:54 AM Eelco Chaudron <echau...@redhat.com> wrote: >>> >>> >>> >>> On 12 Jun 2023, at 15:11, Mike Pattrick wrote: >>> >>>> On Tue, May 30, 2023 at 10:23 AM Robin Jarry <rja...@redhat.com> wrote: >>>>> >>>>> EditorConfig is a file format and collection of text editor plugins for >>>>> maintaining consistent coding styles between different editors and IDEs. >>>>> >>>>> Initialize the file following the coding rules in >>>>> Documentation/internals/contributing/coding-style.rst >>>>> >>>>> In order for this file to be taken into account (unless they use an >>>>> editor with built-in EditorConfig support), developers will have to >>>>> install a plugin. >>>>> >>>>> Note: The max_line_length property is only supported by a limited number >>>>> of EditorConfig plugins. It will be ignored if unsupported. >>>>> >>>>> Link: https://editorconfig.org/ >>>>> Link: https://github.com/editorconfig/editorconfig-emacs >>>>> Link: https://github.com/editorconfig/editorconfig-vim >>>>> Link: >>>>> https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length >>>>> Signed-off-by: Robin Jarry <rja...@redhat.com> >>>>> --- >>>> >>>> Great idea, editorconfig is super convenient to have. >>> >>> I also like the idea, but the editoconfig does not seem to bring much to >>> the table for C. And it looks like there is not much activity on the >>> project. It might be better to look at clang-format, however, this is c/c++ >>> specific. >> >> It doesn't seem like much, but the automatic reconfiguration of >> indentation and line width is really handy, especially for newer or >> infrequent contributors. Especially when the related project DPDK uses >> almost the exact opposite for settings (and already includes its own >> editorconfig)
I'm a bit concerned that this patch is applying the same config to all the .c|.h files in the repo while not all of them have the same coding style. The most obvious is that linux headers are using tabs, not spaces. Not so obvious - sFlow implementation that was imported as-is from the other source. There are some other examples. I'm afraid that some editors will try to fix existing code while saving unrelated changes. Best regards, Ilya Maximets. >> >>> >>> Just my 2c, but we might end up with a configuration file for each person’s >>> favorite editor/linter. >> >> The nice thing about editorconfig is it comes with support for a large >> number of different editors. But even if we wanted to add a few more >> similar tools, I don't think that would be a big issue or cause any >> additional overhead for people who don't want to use those >> configurations. > > I’m fine with adding this, was just wondering if there would be a better > option. > > Acked-by: Eelco Chaudron <echau...@redhat.com> > > I guess you could just have your editor figure out indent mode/size based on > the file content :) > >>> >>>> Acked-by: Mike Pattrick <m...@redhat.com> >>>> >>>>> >>>>> Notes: >>>>> v2: add .editorconfig to EXTRA_DIST >>>>> >>>>> .editorconfig | 14 ++++++++++++++ >>>>> Makefile.am | 1 + >>>>> 2 files changed, 15 insertions(+) >>>>> create mode 100644 .editorconfig >>>>> >>>>> diff --git a/.editorconfig b/.editorconfig >>>>> new file mode 100644 >>>>> index 000000000000..f7f43ecfeea3 >>>>> --- /dev/null >>>>> +++ b/.editorconfig >>>>> @@ -0,0 +1,14 @@ >>>>> +# See https://editorconfig.org/ for syntax reference. >>>>> + >>>>> +root = true >>>>> + >>>>> +[*] >>>>> +end_of_line = lf >>>>> +insert_final_newline = true >>>>> +trim_trailing_whitespace = true >>>>> +charset = utf-8 >>>>> +max_line_length = 79 >>>>> + >>>>> +[*.{c,h}] >>>>> +indent_style = space >>>>> +indent_size = 4 >>>>> diff --git a/Makefile.am b/Makefile.am >>>>> index df9c33dfe631..db341504d37f 100644 >>>>> --- a/Makefile.am >>>>> +++ b/Makefile.am >>>>> @@ -82,6 +82,7 @@ EXTRA_DIST = \ >>>>> .ci/osx-build.sh \ >>>>> .ci/osx-prepare.sh \ >>>>> .cirrus.yml \ >>>>> + .editorconfig \ >>>>> .github/workflows/build-and-test.yml \ >>>>> appveyor.yml \ >>>>> boot.sh \ >>>>> -- >>>>> 2.40.1 >>>>> >>>>> _______________________________________________ >>>>> dev mailing list >>>>> d...@openvswitch.org >>>>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev >>>>> >>>> >>>> _______________________________________________ >>>> dev mailing list >>>> d...@openvswitch.org >>>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev >>> > > _______________________________________________ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev