Eclipse使用google代码风格格式化

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

image.png

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

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

你可能感兴趣的:(Eclipse使用google代码风格格式化)