misc: init .editorconfig

TL;DR: Improved developer productivity for many contributors

Add a shared .editorconfig so contributors get lightweight,
editor-native hints while writing code instead of only discovering
formatting issues later in style checks.

This is advisory, but useful: editors can already guide indentation,
whitespace, line endings, and final newlines as you type. They can also
show a visual guide at the 80-character line width, which is one of the
main motivations here. Most LLM-generated code and contributions over
the past year have already conventionally followed the 80-character
limit, so this makes the expected style visible and consistent for
everyone.

.editorconfig is a decade-old standard, and virtually every editor or
IDE supports it.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
Philipp Schuster
2026-05-13 11:33:56 +02:00
committed by Bo Chen
parent cde761a90d
commit 96700bbfc7

25
.editorconfig Normal file
View File

@@ -0,0 +1,25 @@
# https://editorconfig.org/
#
# Hints for editors to assist with correct formatting as you type.
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
indent_size = 4
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
# Recommendation, not enforced.
max_line_length = 80
[Makefile]
indent_style = tab
# Inherited as default
# [*.sh]
# indent_size = 4
[{Cargo.lock,*.md,*.toml,*.yml,*.yaml}]
indent_size = 2