问题
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