Using checkstyle to format code

╄→гoц情女王★ 提交于 2019-12-22 22:17:24

问题


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


回答1:


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




回答2:


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/



来源:https://stackoverflow.com/questions/12872283/using-checkstyle-to-format-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!