intelij IDEA设置goole code style风格

1.安装google-java-format 插件 
    file ->Setings... ->pligins
    输入上诉插件安装
2.下载IntelliJ Java Google Style file文件
    文件已经挂在本人博客,https://download.csdn.net/download/banana1006034246/10785007
    或者官网https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml
    复制粘贴命名为intellij-java-google-style.xml,在IDEA中设置
    file-> editor->code style 点击右窗体里scheme后面的设置图标,选择import scheme找到你的xml文件,之后按提示确定就行

问题:
遇到错误 intellij idea code style xml import failed with error message null 
原因:xml里面含有空行,这种情况常常出现在使用 linux 的wget命令下载官方xml文件导致

参考文献

google java code style 中文版
https://github.com/google/google-java-format

猜你喜欢

转载自blog.csdn.net/banana1006034246/article/details/84071935