谷歌代码格式化下载地址:https://github.com/google/styleguide
如图:

下载下来以后在eclipse中导入Google代码风格
Window==>Preferences==>Java==>Code Style==>Formatter

导入成功即可。
另外注释不需要被格式化的可以取消注释格式化
在Eclipse里设置格式化代码时不格式化注释
Windows ==> Preferces ==> java ==> Code Style ==> Formatter 或者搜索Formatter
编辑Edit 进入Comments选项卡
取消勾选“Enable Javadoc comment formatting”.

网友评论