eclipse设置符合Checkstyle的Google代码规范

1.tab键:Google要求中不能使用tab键,勾选window下preferces的insert spaces for tabs

 

eclipse设置符合Checkstyle的Google代码规范

2.缩进长度,默认四个字符,Google要求两个:java->code style->edit选择space only,更改下面的缩进和tab的长度为2,重新命名格式,防止以前的消失

eclipse设置符合Checkstyle的Google代码规范

3.switch case的缩进,默认为switch case不缩进,改为缩进两个,位置同上,勾选红色划线

eclipse设置符合Checkstyle的Google代码规范

4.每行长度,Google要求100默认120,修改maximum line width

eclipse设置符合Checkstyle的Google代码规范