From 81a4527433f360e9d87a9ee9f167735562b8392e Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 18 Sep 2025 10:33:05 +0800 Subject: [PATCH] * [misc] Add .editorconfig to unify coding style. --- .editorconfig | 39 +++++++++++++++++++++++++++++++++++++++ .gitignore | 1 - 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..854e20aeca --- /dev/null +++ b/.editorconfig @@ -0,0 +1,39 @@ +# 顶级 EditorConfig 文件 +root = true + +[*] +# 缩进风格:空格或制表符 +indent_style = space + +# 缩进大小 +indent_size = 4 + +# 行结束符:lf, cr, crlf +end_of_line = lf + +# 字符编码 +charset = utf-8 + +# 是否删除行尾空白字符 +trim_trailing_whitespace = true + +# 是否在文件末尾插入空行 +insert_final_newline = true + +# 最大行长度(关闭此规则) +max_line_length = off + +# 制表符宽度(当 indent_style = tab 时) +tab_width = 4 + +# 为 Markdown 文件保留尾部空格(用于换行) +[*.md] +trim_trailing_whitespace = false + +# 为 YAML 文件使用 2 空格缩进 +[*.{yml,yaml}] +indent_size = 2 + +# 为 Makefile 使用制表符(必须) +[Makefile] +indent_style = tab diff --git a/.gitignore b/.gitignore index 8306902ab4..1b2d9f4c54 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,6 @@ vendor/ docker .docker-sync composer.lock -.editorconfig CodeSniffer.conf test/runtime test/runtime/*