# 编辑器与工具的统一约定。见 docs/adr/ 里关于编码的决定。
root = true

[*]
indent_style             = space
indent_size              = 4
end_of_line              = lf
insert_final_newline     = true
trim_trailing_whitespace = true
charset                  = utf-8

# PowerShell 源码必须带 BOM。
# 没有 BOM 时，Windows PowerShell 5.1 会按 ANSI 代码页解码源码文件：中文变乱码，
# 而全角问号之类的字节序列会吃掉字符串引号，整块语法随之失效
# （实测：全仓 6/6 文件在 5.1 上解析失败）。UTF-8 with BOM 是同时满足 5.1 与 7 的唯一编码。
[*.{ps1,psm1,psd1}]
charset = utf-8-bom

# 清单是纯文本，且被脚本以 Get-Content 读取；带 BOM 让两个版本都能正确识别编码。
[BackupList.txt]
charset = utf-8-bom

# YAML / JSON / 配置数据不带 BOM
[*.{json,yml,yaml}]
charset = utf-8

# Markdown 不做尾随空格裁剪：行尾两个空格是合法且常用的硬换行。
[*.md]
trim_trailing_whitespace = false
