A free and open-source SonarQube plugin for static code analysis of Scala projects.
sonar-scala is an independent SonarQube plugin, driven by and developed with :heart: by the community.
Intended for SonarQube 6.7 LTS, SonarQube 7.9 LTS, SonarQube 8.2 and Scala 2.11/2.12/2.13.
sonar-scala is developed in Scala. It uses the scalariform library to parse the source code and integrates with Scoverage (code coverage), Scalastyle and Scapegoat (static code analysis). It also provides pull request decoration functionality, which can review pull requests on Github and make comments on new issues directly in the pull request instead of reporting them to SonarQube.
Running analysis from a Windows machine is currently not supported - please use Linux or other Unix-like operating system.
See the project website sonar-scala.com for documentation.
To build the project from sources, run the assembly
task in sbt shell and the
jar assembled with all of the dependencies required by this plugin should be
created in the target/scala-2.13
directory.
To debug the plugin, export the following environment variable before running
sonar-scanner
for your project:
export SONAR_SCANNER_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000"
Once you've done that, sonar-scanner
should display the following message
Listening for transport dt_socket at address: 8000
. You can now attach your
IDE to the process on port 8000
, set breakpoints and debug the code.
This project is a continuation of the sonar-scala plugin, which was initially developed by Sagacify.
Many other projects have been used as an inspiration, here is a list of the main ones:
- RadoBuransky/sonar-scoverage-plugin
- arthepsy/sonar-scala-extra
- 1and1/sonar-scala
- SonarSource/sonar-java
- SonarSource/sonar-examples
- SonarSource/sonar-github
For a full list of changes and releases, please see Changelog.
The project is licensed under the GNU LGPL v3. See the LICENSE file for more details.