A free and open-source SonarQube plugin for static code analysis of Scala projects.
Updated Scalastyle to v1.1.0, which brings the following changes:
New Scalastyle rules (#342 - @mwz):
ForLoopChecker
rule - omit braces if you have a yield
clause, otherwise, surround the contents with curly-braces, even if the contents are only a single line.WhileBraceChecker
rule - it's recommended to never omit braces when using while
.CaseBraceChecker
rule - braces aren't required in case
clauses.Scalastyle rule changes:
HeaderMatchesChecker
has a new parameter regex
to indicate whether to treat the header string as a regular expression; defaults to false
.MethodLengthChecker
has a new parameter ignoreEmpty
to exclude empty lines from being counted; defaults to false
.ForBraceChecker
has a new parameter singleLineAllowed
to indicate whether a one-line for
expressions with parentheses are allowed; defaults to false
.NonASCIICharacterChecker
has a new parameter allowStringLiterals
to indicate whether non-ASCII scripts in string literals should be allowed; defaults to false
.All of the above rules are activated with the default parameter values in the Scalastyle
, Scalastyle+Scapegoat
and the Recommended by sonar-scala
quality profiles.
The plugin is available for download from Bintray.
The plugin is available for download from Bintray.
The plugin is available for download from Bintray.
PreferMapEmpty
. (#227 - @mwz)The plugin is available for download from Bintray.
The plugin is available for download from Bintray.
sonar.scala.scoverage.disable
property, which can be used to disable the Scoverage sensor (defaults to false
). (#169 - @BalmungSan)The plugin is available for download from Bintray.
The plugin is available for download from Bintray.
The plugin is available for download from Bintray.
sonar.tests
property which should point to directories containing tests (usually src/test/scala
) and make sure you run your unit tests before you trigger sonar-scanner analysis. That's all you need to do in sbt unless you've changed the default location where sbt saves JUnit XML reports - then you'll also need to set the sonar.junit.reportPaths
property (which defaults to target/test-reports
). For projects using Gradle, setting both properties is necessary to make use of the sensor (Gradle outputs those in build/test-results/test
), and Maven additionally requires the Surefire plugin to be installed. Please refer to the sample projects for example configuration for each build tool. (#143 - @mwz)sonar.scala.version
property. (#139 - @mwz)The plugin is available for download from Bintray.