* [dpdk-dev] [PATCH] tools: add EditorConfig file
@ 2019-10-18 7:59 Robin Jarry
2019-10-18 9:08 ` Burakov, Anatoly
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Robin Jarry @ 2019-10-18 7:59 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
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
doc/guides/contributing/coding_style.rst,
doc/guides/contributing/documentation.rst and
doc/guides/contributing/patches.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.
Add this new file in MAINTAINERS in the "Developers and Maintainers
Tools" section.
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
Cc: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
---
.editorconfig | 23 +++++++++++++++++++++++
MAINTAINERS | 1 +
2 files changed, 24 insertions(+)
create mode 100644 .editorconfig
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000000..c5704d89b8c6
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,23 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019 6WIND S.A.
+
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+indent_style = tab
+tab_width = 8
+max_line_length = 80
+
+[**.py]
+indent_style = space
+indent_size = 4
+
+[**.rst]
+indent_style = space
+indent_size = 3
+
+[COMMIT_EDITMSG]
+max_line_length = 72
diff --git a/MAINTAINERS b/MAINTAINERS
index f8a56e2e2615..16b4eb18cafa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -82,6 +82,7 @@ F: doc/
Developers and Maintainers Tools
M: Thomas Monjalon <thomas@monjalon.net>
+F: .editorconfig
F: MAINTAINERS
F: devtools/check-dup-includes.sh
F: devtools/check-maintainers.sh
--
2.23.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] tools: add EditorConfig file
2019-10-18 7:59 [dpdk-dev] [PATCH] tools: add EditorConfig file Robin Jarry
@ 2019-10-18 9:08 ` Burakov, Anatoly
2019-10-18 15:47 ` Stephen Hemminger
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Burakov, Anatoly @ 2019-10-18 9:08 UTC (permalink / raw)
To: Robin Jarry, Thomas Monjalon; +Cc: dev
On 18-Oct-19 8:59 AM, Robin Jarry 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
> doc/guides/contributing/coding_style.rst,
> doc/guides/contributing/documentation.rst and
> doc/guides/contributing/patches.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.
>
> Add this new file in MAINTAINERS in the "Developers and Maintainers
> Tools" section.
>
> 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
> Cc: Thomas Monjalon <thomas@monjalon.net>
> Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
> ---
+1, we need things like this. It would also be good to finally get a
.clang-format file...
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] tools: add EditorConfig file
2019-10-18 7:59 [dpdk-dev] [PATCH] tools: add EditorConfig file Robin Jarry
2019-10-18 9:08 ` Burakov, Anatoly
@ 2019-10-18 15:47 ` Stephen Hemminger
2019-10-18 15:55 ` Robin Jarry
2019-10-18 15:48 ` Stephen Hemminger
2019-10-25 14:04 ` [dpdk-dev] [PATCH v2] devtools: " Robin Jarry
3 siblings, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2019-10-18 15:47 UTC (permalink / raw)
To: Robin Jarry; +Cc: Thomas Monjalon, dev
On Fri, 18 Oct 2019 09:59:54 +0200
Robin Jarry <robin.jarry@6wind.com> wrote:
Looks good, you should add a reference to
https://editorconfig.org so others understand this
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright 2019 6WIND S.A.
> +
> +root = true
> +
> +[*]
> +end_of_line = lf
> +insert_final_newline = true
> +charset = utf-8
> +indent_style = tab
> +tab_width = 8
> +max_line_length = 80
> +
> +[**.py]
> +indent_style = space
> +indent_size = 4
In the example on web site, they use
[*.py] not [**.py]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] tools: add EditorConfig file
2019-10-18 7:59 [dpdk-dev] [PATCH] tools: add EditorConfig file Robin Jarry
2019-10-18 9:08 ` Burakov, Anatoly
2019-10-18 15:47 ` Stephen Hemminger
@ 2019-10-18 15:48 ` Stephen Hemminger
2019-10-18 15:56 ` Robin Jarry
2019-10-25 14:04 ` [dpdk-dev] [PATCH v2] devtools: " Robin Jarry
3 siblings, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2019-10-18 15:48 UTC (permalink / raw)
To: Robin Jarry; +Cc: Thomas Monjalon, dev
On Fri, 18 Oct 2019 09:59:54 +0200
Robin Jarry <robin.jarry@6wind.com> wrote:
> diff --git a/.editorconfig b/.editorconfig
> new file mode 100644
> index 000000000000..c5704d89b8c6
> --- /dev/null
> +++ b/.editorconfig
> @@ -0,0 +1,23 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright 2019 6WIND S.A.
> +
> +root = true
> +
> +[*]
> +end_of_line = lf
> +insert_final_newline = true
> +charset = utf-8
> +indent_style = tab
> +tab_width = 8
> +max_line_length = 80
Why not add this (since git doesn't like trailing whitespace).
trim_trailing_whitespace=true
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] tools: add EditorConfig file
2019-10-18 15:47 ` Stephen Hemminger
@ 2019-10-18 15:55 ` Robin Jarry
0 siblings, 0 replies; 10+ messages in thread
From: Robin Jarry @ 2019-10-18 15:55 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Thomas Monjalon, dev
2019-10-18, Stephen Hemminger:
> In the example on web site, they use
> [*.py] not [**.py]
I've tested both forms, they work the same. I don't have a strong
opinion on this, I can change to [*.py].
--
Robin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] tools: add EditorConfig file
2019-10-18 15:48 ` Stephen Hemminger
@ 2019-10-18 15:56 ` Robin Jarry
2019-10-18 16:08 ` Stephen Hemminger
0 siblings, 1 reply; 10+ messages in thread
From: Robin Jarry @ 2019-10-18 15:56 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Thomas Monjalon, dev
2019-10-18, Stephen Hemminger:
> Why not add this (since git doesn't like trailing whitespace).
>
> trim_trailing_whitespace=true
Because EditorConfig applies the setting to the whole file when saving.
This has chances of trimming white space on lines that you did not
modify. I figure this is not what we want.
--
Robin
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] tools: add EditorConfig file
2019-10-18 15:56 ` Robin Jarry
@ 2019-10-18 16:08 ` Stephen Hemminger
2019-10-21 9:01 ` Bruce Richardson
0 siblings, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2019-10-18 16:08 UTC (permalink / raw)
To: Robin Jarry; +Cc: Thomas Monjalon, dev
On Fri, 18 Oct 2019 17:56:48 +0200
Robin Jarry <robin.jarry@6wind.com> wrote:
> 2019-10-18, Stephen Hemminger:
> > Why not add this (since git doesn't like trailing whitespace).
> >
> > trim_trailing_whitespace=true
>
> Because EditorConfig applies the setting to the whole file when saving.
> This has chances of trimming white space on lines that you did not
> modify. I figure this is not what we want.
>
Current DPDK does not have trailing white space, I run a script over it
perodically to check.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] tools: add EditorConfig file
2019-10-18 16:08 ` Stephen Hemminger
@ 2019-10-21 9:01 ` Bruce Richardson
0 siblings, 0 replies; 10+ messages in thread
From: Bruce Richardson @ 2019-10-21 9:01 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Robin Jarry, Thomas Monjalon, dev
On Fri, Oct 18, 2019 at 09:08:25AM -0700, Stephen Hemminger wrote:
> On Fri, 18 Oct 2019 17:56:48 +0200
> Robin Jarry <robin.jarry@6wind.com> wrote:
>
> > 2019-10-18, Stephen Hemminger:
> > > Why not add this (since git doesn't like trailing whitespace).
> > >
> > > trim_trailing_whitespace=true
> >
> > Because EditorConfig applies the setting to the whole file when saving.
> > This has chances of trimming white space on lines that you did not
> > modify. I figure this is not what we want.
> >
>
>
> Current DPDK does not have trailing white space, I run a script over it
> perodically to check.
+1 for including this.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH v2] devtools: add EditorConfig file
2019-10-18 7:59 [dpdk-dev] [PATCH] tools: add EditorConfig file Robin Jarry
` (2 preceding siblings ...)
2019-10-18 15:48 ` Stephen Hemminger
@ 2019-10-25 14:04 ` Robin Jarry
2020-02-22 20:03 ` Thomas Monjalon
3 siblings, 1 reply; 10+ messages in thread
From: Robin Jarry @ 2019-10-25 14:04 UTC (permalink / raw)
To: Thomas Monjalon
Cc: dev, Stephen Hemminger, Anatoly Burakov, Keith Wiles,
Ray Kinsella, Andrew Rybchenko
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
doc/guides/contributing/coding_style.rst,
doc/guides/contributing/documentation.rst and
doc/guides/contributing/patches.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.
Add this new file in MAINTAINERS in the "Developers and Maintainers
Tools" section.
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
Cc: Thomas Monjalon <thomas@monjalon.net>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: Keith Wiles <keith.wiles@intel.com>
Cc: Ray Kinsella <mdr@ashroe.eu>
Cc: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
---
Changelog:
v2:
- Add link to editorconfig.org in file for syntax reference.
- Use [*.EXT] syntax for section headers (as shown on home page).
- Add trim_trailing_whitespace option.
.editorconfig | 25 +++++++++++++++++++++++++
MAINTAINERS | 1 +
2 files changed, 26 insertions(+)
create mode 100644 .editorconfig
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000000..d70582557497
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2019 6WIND S.A.
+# See https://editorconfig.org/ for syntax reference.
+
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+charset = utf-8
+indent_style = tab
+tab_width = 8
+max_line_length = 80
+
+[*.py]
+indent_style = space
+indent_size = 4
+
+[*.rst]
+indent_style = space
+indent_size = 3
+
+[COMMIT_EDITMSG]
+max_line_length = 72
diff --git a/MAINTAINERS b/MAINTAINERS
index f8a56e2e2615..16b4eb18cafa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -82,6 +82,7 @@ F: doc/
Developers and Maintainers Tools
M: Thomas Monjalon <thomas@monjalon.net>
+F: .editorconfig
F: MAINTAINERS
F: devtools/check-dup-includes.sh
F: devtools/check-maintainers.sh
--
2.23.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] devtools: add EditorConfig file
2019-10-25 14:04 ` [dpdk-dev] [PATCH v2] devtools: " Robin Jarry
@ 2020-02-22 20:03 ` Thomas Monjalon
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2020-02-22 20:03 UTC (permalink / raw)
To: Robin Jarry
Cc: dev, Stephen Hemminger, Anatoly Burakov, Keith Wiles,
Ray Kinsella, Andrew Rybchenko
25/10/2019 16:04, Robin Jarry:
> 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
> doc/guides/contributing/coding_style.rst,
> doc/guides/contributing/documentation.rst and
> doc/guides/contributing/patches.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.
>
> Add this new file in MAINTAINERS in the "Developers and Maintainers
> Tools" section.
>
> 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
> Cc: Thomas Monjalon <thomas@monjalon.net>
> Cc: Stephen Hemminger <stephen@networkplumber.org>
> Cc: Anatoly Burakov <anatoly.burakov@intel.com>
> Cc: Keith Wiles <keith.wiles@intel.com>
> Cc: Ray Kinsella <mdr@ashroe.eu>
> Cc: Andrew Rybchenko <arybchenko@solarflare.com>
> Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
> ---
> Changelog:
>
> v2:
>
> - Add link to editorconfig.org in file for syntax reference.
> - Use [*.EXT] syntax for section headers (as shown on home page).
> - Add trim_trailing_whitespace option.
This patch was forgotten, sorry.
Applied, thanks it looks to be a good addition.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-02-22 20:03 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 7:59 [dpdk-dev] [PATCH] tools: add EditorConfig file Robin Jarry
2019-10-18 9:08 ` Burakov, Anatoly
2019-10-18 15:47 ` Stephen Hemminger
2019-10-18 15:55 ` Robin Jarry
2019-10-18 15:48 ` Stephen Hemminger
2019-10-18 15:56 ` Robin Jarry
2019-10-18 16:08 ` Stephen Hemminger
2019-10-21 9:01 ` Bruce Richardson
2019-10-25 14:04 ` [dpdk-dev] [PATCH v2] devtools: " Robin Jarry
2020-02-22 20:03 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).