Sonar Dart Plugin
![License](https://camo.githubusercontent.com/6971d85ca0f9b10c95b7852c9ed4c04969764abe66f06eafb4e7daf111358885/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442532302d677265656e2e737667)
A Dart SonarQube plugin compatible with SonarQube 8.x.
This plugin relies on the output of the dartanalyzer for the generation of SonarQube issues. Please refer to the configuration key sonar.dart.analyzer
.
Requirements
- SonarQube 8.x
- A Dart 2.x code base
Installing
Copy the jar file downloaded from the Releases to the extensions/plugins
folder of your SonarQube server, and restart SonarQube.
Building and Deploying
- Ensure you meet the following development dependencies:
- Java 11+
- Apache Maven 3.x
- Run
mvn clean install
- Copy the jar file from
sonar-dart-plugin/target
to the SonarQubeextensions/plugins
folder - Restart the SonarQube server
Configuration
Example project configuration
This is an example project configuration file (sonar-project.properties
):
sonar.host.url=http://sonar:9000
sonar.login=<my key>
sonar.projectKey=company:my-application
sonar.projectName=My Application
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8
sonar.inclusions=**/lib/src/**
sonar.exclusions=**/.dart_tool/**,**/*.g.dart,**/*.reflectable.dart
sonar.dart.analyzer=dartanalyzer.out
sonar.dart.lcov.reportPaths=lcov.out
- See SonarQube's Analysis Parameters documentation for general configuration options.
- See SonarQube's Narrowing the Focus documentation for filtering which files get analyzed.
Plugin Configuration
Key | Description |
---|---|
sonar.dart.analyzer | Path to the collected output of dartanalyzer. It must be run with --format=machine . For example: dartanalyzer --lints --format=machine --packages=.packages . 2>dartanalyzer.out |
sonar.dart.lcov.reportPaths | A comma separated list of dart test coverage data formatted with coverage:format_coverage. For example: pub run test --coverage coverage && pub run coverage:format_coverage --packages=.packages -i coverage --lcov --out=lcov.out |
License
Copyright 2020 Client Outlook
Licensed under The 3-Clause BSD License