# EditorConfig:统一不同编辑器/IDE 的基础格式,减少因缩进/行尾/空白差异产生的 diff 噪声。
# 文档:https://editorconfig.org
root = true

# 所有文件的通用约定
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

# Python:遵循 PEP 8,4 空格缩进(与项目现有代码一致)
[*.py]
indent_size = 4
max_line_length = 120

# 前端/配置类文件惯用 2 空格
[*.{js,ts,json,jsonc,html,css,yml,yaml}]
indent_size = 2

# Markdown:保留行尾空白(用于换行语义),不裁剪
[*.md]
trim_trailing_whitespace = false

# Makefile 必须用 Tab 缩进
[Makefile]
indent_style = tab

# Windows 批处理脚本使用 CRLF
[*.{bat,cmd,ps1}]
end_of_line = crlf