summaryrefslogtreecommitdiffstats
path: root/.editorconfig
diff options
context:
space:
mode:
authorSalvatore Bonaccorso <carnil@debian.org>2024-02-20 19:25:07 +0100
committerSalvatore Bonaccorso <carnil@debian.org>2024-02-20 19:25:07 +0100
commit7f5b2cb73d9b7e3a76ae69bcf3c73260013a80c5 (patch)
tree3339986320dfc80791425b1787ad7efb7608b859 /.editorconfig
parent3bb3c1702fc146c6272324d87d1de5744f01af28 (diff)
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. For the kernel-sec repository, modelled after the very same change in the 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 Link: https://git.kernel.org/linus/5a602de99797bddc9dd7f73592281a507196f69d Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
Diffstat (limited to '.editorconfig')
-rw-r--r--.editorconfig21
1 files changed, 21 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..c2dbcc40
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,21 @@
+# Copyright © 2024 Salvatore Bonaccorso <carnil@debian.org>
+#
+# This file is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file. If not, see <https://www.gnu.org/licenses/>.
+
+root = true
+
+[*]
+trim_trailing_whitespace = true
+indent_style = space
+indent_size = 1

© 2014-2024 Faster IT GmbH | imprint | privacy policy