Skip to contentSkip to conversation

introduce .editorconfig

PATCH Superseded Dzmitry Sankouski 3 participants 6 messages Mar 1, 2023 – Mar 2, 2023

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover introduce .editorconfig

Current process of sending patches includes running checkpatch.pl script for each patch, and fixing found style problems. Editorconfig may help to prevent some style related problems (like spaces vs tab indentation) on the fly.

Dzmitry Sankouski (1):
editorconfig: introduce .editorconfig

 .editorconfig               | 15 +++++++++++++++
 .gitignore                  |  1 +
 doc/develop/codingstyle.rst |  4 ++++
 3 files changed, 20 insertions(+)
 create mode 100644 .editorconfig
Signature · 1 line
2.30.2
#1 lore raw

PATCH v2 1/1 editorconfig: introduce .editorconfig

Current process of sending patches includes running checkpatch.pl script for each patch, and fixing found style problems. EditorConfig may help to prevent some style related problems (like spaces vs tab indentation) on the fly.

---
Changes for v2:
- add section in coding style rst doc
- unify Kconfig with other files

 .editorconfig               | 15 +++++++++++++++
 .gitignore                  |  1 +
 doc/develop/codingstyle.rst |  4 ++++
 3 files changed, 20 insertions(+)
 create mode 100644 .editorconfig
.editorconfig new file +15 -0
new file mode 100644
index 0000000000..10fe165f09
@@ -0,0 +1,15 @@
+; This file is for unifying the coding style for different editors and IDEs.
+; Plugins are available for notepad++, emacs, vim, gedit,
+; textmate, visual studio, and more.
+;
+; See http://editorconfig.org for details.
+
+# Top-most EditorConfig file.
+root = true
+
+[{**.c, **.h, **Kconfig}]
+indent_style = tab
+indent_size=8
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
.gitignore +1 -0
index 3a4d056edf..ed8ca226fe 100644
@@ -7,6 +7,7 @@
 #
 .*
 !.checkpatch.conf
+!.editorconfig
 *.a
 *.asn1.[ch]
 *.bin
doc/develop/codingstyle.rst +4 -0
index 1d5d0192b3..741bc58b83 100644
@@ -27,6 +27,10 @@ The following rules apply:
   more information, read :doc:`checkpatch`. Note that this should be done
   *before* posting on the mailing list!
 
+* Some code style rules may be applied automatically by your editor using
+  EditorConfig tool. Feel free to setup your editor to work with u-boot's
+  .editorconfig.
+
 * Source files originating from different projects (for example the MTD
   subsystem or the hush shell code from the BusyBox project) may, after
   careful consideration, be exempted from these rules. For such files, the
Signature · 1 line
2.30.2
#2 lore raw

Re: [PATCH v2 1/1] editorconfig: introduce .editorconfig

Quoted 25 lines · Dzmitry Sankouski

Current process of sending patches includes running checkpatch.pl script for each patch, and fixing found style problems. EditorConfig may help to prevent some style related problems (like spaces vs tab indentation) on the fly.

---
Changes for v2:
- add section in coding style rst doc
- unify Kconfig with other files

 .editorconfig               | 15 +++++++++++++++
 .gitignore                  |  1 +
 doc/develop/codingstyle.rst |  4 ++++
 3 files changed, 20 insertions(+)
 create mode 100644 .editorconfig
.editorconfig new file +2 -0
new file mode 100644
index 0000000000..10fe165f09
@@ -0,0 +1,15 @@
+; This file is for unifying the coding style for different editors and IDEs.
+; Plugins are available for notepad++, emacs, vim, gedit,

.editorconfig line 12

Quoted 10 lines
.editorconfig new file +10 -0
+; textmate, visual studio, and more.
+;
+; See http://editorconfig.org for details.
+
+# Top-most EditorConfig file.
+root = true
+
+[{**.c, **.h, **Kconfig}]
+indent_style = tab
+indent_size=8

As Simon noted before, this should be " = 8".

Quoted 20 lines
.editorconfig new file +3 -0
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
.gitignore +1 -0
index 3a4d056edf..ed8ca226fe 100644
@@ -7,6 +7,7 @@
 #
 .*
 !.checkpatch.conf
+!.editorconfig
 *.a
 *.asn1.[ch]
 *.bin
doc/develop/codingstyle.rst +0 -0
index 1d5d0192b3..741bc58b83 100644

doc/develop/codingstyle.rst The following rules apply: · line 30

Quoted 4 lines
doc/develop/codingstyle.rst +1 -0
@@ -27,6 +27,10 @@ The following rules apply:
   more information, read :doc:`checkpatch`. Note that this should be done
   *before* posting on the mailing list!
 
+* Some code style rules may be applied automatically by your editor using

"using the"

Quoted 1 line
doc/develop/codingstyle.rst +1 -0
+  EditorConfig tool. Feel free to setup your editor to work with u-boot's
Signature · 1 line
Tom
#3 lore raw

Re: [PATCH v2 1/1] editorconfig: introduce .editorconfig

ср, 1 мар. 2023 г. в 18:58, Tom Rini <[email protected]>:

Quoted 31 lines · Dzmitry Sankouski
Quoted 29 lines

Current process of sending patches includes running checkpatch.pl script for each patch, and fixing found style problems. EditorConfig may help to prevent some style related problems (like spaces vs tab indentation) on the fly.

---
Changes for v2:
- add section in coding style rst doc
- unify Kconfig with other files

 .editorconfig               | 15 +++++++++++++++
 .gitignore                  |  1 +
 doc/develop/codingstyle.rst |  4 ++++
 3 files changed, 20 insertions(+)
 create mode 100644 .editorconfig
.editorconfig new file +6 -0
new file mode 100644
index 0000000000..10fe165f09
@@ -0,0 +1,15 @@
+; This file is for unifying the coding style for different editors and IDEs.
+; Plugins are available for notepad++, emacs, vim, gedit,
+; textmate, visual studio, and more.
+;
+; See http://editorconfig.org for details.
+
Quoted 9 lines

.editorconfig line 12

Quoted 6 lines
.editorconfig new file +6 -0
+# Top-most EditorConfig file.
+root = true
+
+[{**.c, **.h, **Kconfig}]
+indent_style = tab
+indent_size=8

As Simon noted before, this should be " = 8".

oops, I thought he meant consistent spacing in a sense of 8 spaces. I personally like Kconfigs with 4 indent more.

#4 lore raw

Re: [PATCH v2 1/1] editorconfig: introduce .editorconfig

Quoted 41 lines · Dzmitry Sankouski

ср, 1 мар. 2023 г. в 18:58, Tom Rini <[email protected]>:

Quoted 31 lines · Dzmitry Sankouski
Quoted 29 lines

Current process of sending patches includes running checkpatch.pl script for each patch, and fixing found style problems. EditorConfig may help to prevent some style related problems (like spaces vs tab indentation) on the fly.

---
Changes for v2:
- add section in coding style rst doc
- unify Kconfig with other files

 .editorconfig               | 15 +++++++++++++++
 .gitignore                  |  1 +
 doc/develop/codingstyle.rst |  4 ++++
 3 files changed, 20 insertions(+)
 create mode 100644 .editorconfig
.editorconfig new file +6 -0
new file mode 100644
index 0000000000..10fe165f09
@@ -0,0 +1,15 @@
+; This file is for unifying the coding style for different editors and IDEs.
+; Plugins are available for notepad++, emacs, vim, gedit,
+; textmate, visual studio, and more.
+;
+; See http://editorconfig.org for details.
+
Quoted 9 lines

.editorconfig line 12

Quoted 6 lines
.editorconfig new file +6 -0
+# Top-most EditorConfig file.
+root = true
+
+[{**.c, **.h, **Kconfig}]
+indent_style = tab
+indent_size=8

As Simon noted before, this should be " = 8".

Quoted 2 lines

oops, I thought he meant consistent spacing in a sense of 8 spaces. I personally like Kconfigs with 4 indent more.

Ah. But, in both cases it should be 8, as well.

Signature · 1 line
Tom
#5 lore raw

Re: [PATCH v2 1/1] editorconfig: introduce .editorconfig

In reply to Dzmitry Sankouski

Hi Dzmitry,

Quoted 7 lines · Dzmitry Sankouski

Current process of sending patches includes running checkpatch.pl script for each patch, and fixing found style problems. EditorConfig may help to prevent some style related problems (like spaces vs tab indentation) on the fly.

You missed giving your Signed-off-by tag.