Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add .editorconfig file for basic formatting

EditorConfig is a specification to define the most basic code formatting
stuff, and it's supported by many editors and IDEs, either directly or
via plugins, including VSCode/VSCodium, Vim, emacs and more.

It allows to define formatting style related to indentation, charset,
end of lines and trailing whitespaces. It also allows to apply different
formats for different files based on wildcards, so for example it is
possible to apply different configs to *.{c,h}, *.py and *.rs.

In linux project, defining a .editorconfig might help to those people
that work on different projects with different indentation styles, so
they cannot define a global style. Now they will directly see the
correct indentation on every fresh clone of the project.

See https://editorconfig.org

Co-developed-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
Acked-by: Mickaël Salaün <mic@digikod.net>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Tested-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Íñigo Huguet and committed by
Masahiro Yamada
5a602de9 ac14947c

+41
+32
.editorconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + 3 + root = true 4 + 5 + [{*.{awk,c,dts,dtsi,dtso,h,mk,s,S},Kconfig,Makefile,Makefile.*}] 6 + charset = utf-8 7 + end_of_line = lf 8 + trim_trailing_whitespace = true 9 + insert_final_newline = true 10 + indent_style = tab 11 + indent_size = 8 12 + 13 + [*.{json,py,rs}] 14 + charset = utf-8 15 + end_of_line = lf 16 + trim_trailing_whitespace = true 17 + insert_final_newline = true 18 + indent_style = space 19 + indent_size = 4 20 + 21 + # this must be below the general *.py to overwrite it 22 + [tools/{perf,power,rcu,testing/kunit}/**.py,] 23 + indent_style = tab 24 + indent_size = 8 25 + 26 + [*.yaml] 27 + charset = utf-8 28 + end_of_line = lf 29 + trim_trailing_whitespace = unset 30 + insert_final_newline = true 31 + indent_style = space 32 + indent_size = 2
+1
.gitignore
··· 96 96 # 97 97 !.clang-format 98 98 !.cocciconfig 99 + !.editorconfig 99 100 !.get_maintainer.ignore 100 101 !.gitattributes 101 102 !.gitignore
+4
Documentation/process/4.Coding.rst
··· 66 66 See the file :ref:`Documentation/process/clang-format.rst <clangformat>` 67 67 for more details. 68 68 69 + Some basic editor settings, such as indentation and line endings, will be 70 + set automatically if you are using an editor that is compatible with 71 + EditorConfig. See the official EditorConfig website for more information: 72 + https://editorconfig.org/ 69 73 70 74 Abstraction layers 71 75 ******************
+4
Documentation/process/coding-style.rst
··· 735 735 See the file :ref:`Documentation/process/clang-format.rst <clangformat>` 736 736 for more details. 737 737 738 + Some basic editor settings, such as indentation and line endings, will be 739 + set automatically if you are using an editor that is compatible with 740 + EditorConfig. See the official EditorConfig website for more information: 741 + https://editorconfig.org/ 738 742 739 743 10) Kconfig configuration files 740 744 -------------------------------