Coding with style: The Scalastyle style checker
Scalastyle is a static code analysis tool that helps programmers write Scala code according to the coding standards their project.
It is heavily influenced by Checkstyle, PMD and FindBugs for Java. These tools are used by java developers everywhere, and Scalastyle will help Scala gain more acceptance within companies.
Scalastyle can check many aspects of your code. It has as goals:
- to check the style of your code according to house style (usage of tabs, correct whitespace usage),
- coding conventions (too many parameters to a method, usage of disallowed libraries, usage of return)
- and code which exhibits bug patterns (equals and hashCode not implemented in the same class).
Currently, scalastyle works as standalone, and there is an Eclipse plugin, and plugins for sbt and maven are planned.
In this talk, we discuss why we're creating Scalastyle, what it currently does (the rules that are checked), and how it does it (using the wonderful Scalariform), along with the current state of third part integration (Eclipse, Maven).