Is there a Java coding standards? If so, is there a tool that will check for those standards?

耗尽温柔 提交于 2020-02-05 14:42:45

问题


Are there Java coding standards? If so, is there a tool that implements and checks for those standards? I'm not familiar but hoping that someone has used Sonar, Checkstyle, PMD, Findbugs, Clover, and/or Cobertura that could tell me if any of those tools or other tools can do that.


回答1:


Yes. All of those tools can enforce coding styles (and more).




回答2:


Sun's (now Oracle's) coding conventions documentation is here:

http://www.oracle.com/technetwork/java/codeconv-138413.html

I've used Checkstyle to verify that my code follows these conventions as well as conventions adopted by organizations that I've worked for.




回答3:


IntelliJ can enforce coding styles and standards as well. Its Inspector can also check for possible bugs as you write code.




回答4:


Yes all these tools will do what you want. You can also add custom rules if you need to. You can also get checkstyle and findbugs plugin for Eclipse.



来源:https://stackoverflow.com/questions/4197595/is-there-a-java-coding-standards-if-so-is-there-a-tool-that-will-check-for-tho

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