.editorconfig 配置文件说明

背景

团队开发同一个项目, 使用不同的编译器, 导致编码风格不一致。

规范如下


root = true

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


  • charset: 编码,就utf-8,没什么可说的
  • indent_style 缩进类型
    • tab
    • space
  • indent_size 缩进数量
    • 一般 2 / 4
    • tab
  • end_of_line 换行符格式(开发系统差异)
    • lf (unix)
    • crlf (window)
    • cr (mac)
  • insert_final_newline 是否在文件的最后插入一个空行
    • false
    • true
  • trim_trailing_whitespace 是否删除行尾的空格
    • false
    • true

猜你喜欢

转载自blog.csdn.net/luchuanqi67/article/details/84673387
今日推荐