Kengo's blog

Technical articles about original projects, JVM, Static Analysis and JavaScript.

My ideal Java coding rule checker

 I think coding rule and code analysis is helpful solution for Java. They develop advantage of Java, solidness, and help to change your project easy to read. We can use checkstyle, PMD, findbugs and another solution.

 But I think that they aren't major technology in Java community yet. FOSS project which has checkstyle.xml or pom.xml contains plugins for these tools are minor.

 I guess its reason is interface. These tools isn't easy to use and its configuration file is little hard to read.

 Why these configuration file should be easy to read? Because all coder for project should understand coding rule. If configuration file isn't easy to read, you have to tell rules to your team member. It's very boring and makes your code review worthless.

 The ideal tool must have readable DSL to write rules. I guess Markdown is the best format because we can convert rules to PDF, HTML and wiki formats etc.

 - DTO is class in jp.skypencil.project.dto
 - SERVICE is class which extends jp.skypencil.project.service.AbstractService

 - Inner classes should be static
 - Fields must be private

 - DTO must have default constructor
 - DTO must implement
 - DTO must be public
 - DTO must have #equals and #hashCode

 - Method which returns value should be annotated with javax.annotation.Nonnull or javax.annotation.Nullable

 Implementing it look easy if we can make it as a thin wrapper for existing tool. Does ANTLR3 match to implement? Or using another language is better?