Scalastyle examines your Scala code and indicates potential problems with it. If you have come across Checkstyle for Java, then you’ll have a good idea what scalastyle is. Except that it’s for Scala obviously.
Scalastyle is used as part of the grading framework for the course Functional Programming Principles in Scala by Martin Odersky on Coursera.
How do I use scalastyle?
There are several ways of using it:
- SBT plugin
- Command line
- IntelliJ - you can enable scalastyle in IntelliJ by selecting Settings->Editor->Inspections, then searching for Scalastyle inspections
- sonar-scala - Scala plugin for SonarQube with built in support for Scalastyle
- Codacy - you get out-of-the-box analysis on your git repositories
- Git pre-commit hook
For the list of possible rules, see Implemented Rules.
For a list of current rules, see Implemented Rules.
If you want to add a rule, then please raise an Issue (or even better a pull request).
For the version 1.4.0 rules, see 1.4.0 Implemented Rules.
For the version 1.3.0 rules, see 1.3.0 Implemented Rules.
For the version 1.2.0 rules, see 1.2.0 Implemented Rules.
For the version 1.1.1 rules, see 1.1.1 Implemented Rules.
For the version 1.1.0 rules, see 1.1.0 Implemented Rules.
For the version 1.0.0 rules, see 1.0.0 Implemented Rules.
For older versions, see scalastyle.org.
If you wish to contribute to Scalastyle, please see the Scalastyle Developer Guide.