diff mbox series

[Semihosting,Tests,1/3] .editorconfig: add code conventions for tooling

Message ID 20240513113513.640007-2-alex.bennee@linaro.org (mailing list archive)
State New, archived
Headers show
Series add SYS_GET_CMDLINE test | expand

Commit Message

Alex Bennée May 13, 2024, 11:35 a.m. UTC
It's a pain when you come back to a code base you haven't touched in a
while and realise whatever indent settings you were using having
carried over. Add an editorconfig and be done with it.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 .editorconfig | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 .editorconfig

Comments

Peter Maydell May 20, 2024, 3:06 p.m. UTC | #1
On Mon, 13 May 2024 at 12:35, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> It's a pain when you come back to a code base you haven't touched in a
> while and realise whatever indent settings you were using having
> carried over. Add an editorconfig and be done with it.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  .editorconfig | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>  create mode 100644 .editorconfig
>
> diff --git a/.editorconfig b/.editorconfig
> new file mode 100644
> index 0000000..e1540ae
> --- /dev/null
> +++ b/.editorconfig
> @@ -0,0 +1,28 @@
> +# EditorConfig is a file format and collection of text editor plugins
> +# for maintaining consistent coding styles between different editors
> +# and IDEs. Most popular editors support this either natively or via
> +# plugin.
> +#
> +# Check https://editorconfig.org for details.
> +#
> +# Emacs: you need https://github.com/10sr/editorconfig-custom-majormode-el
> +# to automatically enable the appropriate major-mode for your files
> +# that aren't already caught by your existing config.
> +#
> +
> +root = true
> +
> +[*]
> +end_of_line = lf
> +insert_final_newline = true
> +charset = utf-8
> +
> +[Makefile*]
> +indent_style = tab
> +indent_size = 8
> +emacs_mode = makefile
> +
> +[*.{c,h}]
> +indent_style = space
> +indent_size = 4
> +emacs_mode = c

The QEMU .editorconfig has a stanza for .s/.S files too:

[*.{s,S}]
indent_style = tab
indent_size = 8
emacs_mode = asm

thanks
-- PMM
diff mbox series

Patch

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..e1540ae
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,28 @@ 
+# EditorConfig is a file format and collection of text editor plugins
+# for maintaining consistent coding styles between different editors
+# and IDEs. Most popular editors support this either natively or via
+# plugin.
+#
+# Check https://editorconfig.org for details.
+#
+# Emacs: you need https://github.com/10sr/editorconfig-custom-majormode-el
+# to automatically enable the appropriate major-mode for your files
+# that aren't already caught by your existing config.
+#
+
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+
+[Makefile*]
+indent_style = tab
+indent_size = 8
+emacs_mode = makefile
+
+[*.{c,h}]
+indent_style = space
+indent_size = 4
+emacs_mode = c