Using checkstyle to format code

2019-05-22 04:49发布

I have just installed checkstyle in eclipse. It works by bringing up the appropriate errors in the part of the screen where you place break points. However, I was just wondering whether it actually will format the code for you and indeed add the empty comments etc for you to fill in?

If it does, how do you get it to do it. Thanks

2条回答
贼婆χ
2楼-- · 2019-05-22 05:51

No, checkstyle doesn't format code, it only identifies violations of different types. You can configure Jalopy to format as per your checkstyle configuration.

查看更多
在下西门庆
3楼-- · 2019-05-22 05:53

Checkstyle is a static code analysis tool. It doesn't do formating.

However Eclipse has a preinstalled Java Code Formatter. Have a look here for details: http://www.ralfebert.de/blog/eclipseide/source_formatting/

查看更多
登录 后发表回答