.editorconfig(配置编辑器配置)

配置编辑器配置 .editorconfig

原文:统一代码风格工具

目的:在团队开发中,统一代码格式。

editorconfig不是什么软件,而是一个名为 .editorconfig 的自定义文件。

# EditorConfig文件使用INI格式。斜杠(/)作为路径分隔符,#或者;作为注释。路径支持通配符:
# 表明是最顶层的配置文件,发现设为true时,才会停止查找.editorconfig文件
root = true

# * 匹配除/之外的任意字符
# **    匹配任意字符串
# ? 匹配任意单个字符
# [name]    匹配name字符
# [!name]   不匹配name字符
# [s1,s2,s3]    匹配给定的字符串
# [num1..num2]  匹配num1到mun2直接的整数
[*]
# 文件的charset。有以下几种类型:latin1, utf-8, utf-8-bom, utf-16be, utf-16le
charset = utf-8
# 缩进使用 tab 或者 space
indent_style = space
# 缩进为 space 时,缩进的字符数
indent_size = 2
# 缩进为 tab 时,缩进的宽度
# tab_width = 2
# 换行符的类型。lf, cr, crlf三种
end_of_line = lf
# 是否将行尾空格自动删除
trim_trailing_whitespace = true
# 是否使文件以一个空白行结尾
insert_final_newline = true

猜你喜欢

转载自blog.csdn.net/yumeirener_/article/details/79602772