编程语言
首页 > 编程语言> > java – Android Studio中的EditorConfig

java – Android Studio中的EditorConfig

作者:互联网

Android studio中有一个选项可以启用EditorConfig支持(defaultsettings-> codingstyle对话框),但不确定它是如何工作的.请您告诉我如何在Andriod Studio项目中集成.editorconfig文件?

解决方法:

网站EditorConfig.org有一个很好的解释如何设置它. Android Studio内置了它,因此不需要添加插件或设置Android Studio,只需…

>将.editorconfig文件添加到项目的根目录中(如EditorConfig.org所述)
>启用EditorConfig支持(设置→编辑器→代码样式→启用EditorConfig支持)

注意:

A search for .editorconfig files will stop if the root filepath is reached or an EditorConfig file with root=true is found.

编辑:

我建议从这些方面开始,并根据你的团队认为适合调整它:

# indicate this is the root of the project
root = true

[*.{kt,java,xml,gradle,md}]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

标签:java,android,styles,editorconfig
来源: https://codeday.me/bug/20190527/1163820.html