diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..2800648 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +root = true + +# 换行符与字符集的编辑器侧约束(ENG-001 的辅助机制,仓库层策略以 .gitattributes 为准) +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[*.md] +# Markdown 的行尾双空格是硬换行语法,不做清理 +trim_trailing_whitespace = false + +[*.{json,json5,yml,yaml}] +indent_size = 2 + +[{*.ets,*.ts,*.js,*.mjs}] +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2c5da90 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,50 @@ +# 换行符策略:在仓库层声明,不依赖任何机器本地的 core.autocrlf(ENG-001) +# 入库经 clean 过滤归一为 LF、检出保持 LF;避免"diff 为空却恒显 modified"的幻影脏文件。 +* text=auto eol=lf + +# 文本文件显式声明(覆盖 text=auto 的猜测) +*.ets text eol=lf +*.ts text eol=lf +*.js text eol=lf +*.mjs text eol=lf +*.cjs text eol=lf +*.json text eol=lf +*.json5 text eol=lf +*.md text eol=lf +*.ps1 text eol=lf +*.sh text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.xml text eol=lf +*.txt text eol=lf +*.svg text eol=lf +*.gitignore text eol=lf +*.gitattributes text eol=lf +*.editorconfig text eol=lf + +# 二进制白名单(禁止任何换行转换) +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.webp binary +*.ico binary +*.bmp binary +*.ttf binary +*.otf binary +*.woff binary +*.woff2 binary +*.so binary +*.a binary +*.hap binary +*.app binary +*.har binary +*.hsp binary +*.zip binary +*.gz binary +*.7z binary +*.db binary +*.mp4 binary +*.mp3 binary +*.wav binary +*.jar binary