Intellij Idea 团队协同开发必备配置

可以使用google style的的方法,或者各自公司统一的code Style/file and code template 文件

一、安装google-java-format
preferences -> plugins -> Browse repositories…
搜索google-java-format
这里写图片描述

启用google-java-format
这里写图片描述

二、安装save actions
preferences -> plugins -> Browse repositories…
搜索save actions
这里写图片描述
启用save actions
保存时自动格式化 
将没用的import 语句删除

三、自动优化导包选项

Optimize imports on the fly:自动去掉一些没有用到的包
Add unambiguous imports on the fly:自动帮我们优化导入的包 unambiguous: 明确地

四、检查行分隔符/缩进大小

行分隔符需要统一,不得使用windows
这里写图片描述

缩进大小需要统一
这里写图片描述

扫描二维码关注公众号,回复: 12509334 查看本文章
  •  

猜你喜欢

转载自blog.csdn.net/fei33423/article/details/111594621