Uses eastwood and kibit to analyze clojure code
- Need to install docker-sonar image and create a shared volume by adding the following onto the docker-compose.yml file under sonarqube. (See example)
volumes:
- /opt/sonar/extensions:/opt/sonar/extensions
-
Need to install [sonar-scanner] (https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) and configure sonar-runner.properties to make sonar server accessible (See example)
-
Need to have Eastwood and Kibit added to the profiles.clj (locaed on .lein/) file as plugins.
WARNING: If loading your code (particularly test files) causes side effects like writing files, opening connections to servers, modifying databases, etc., running this plugin on your code will do that too.
Wasn't tested on windows but plausible to run with little modification to source code.
- Clone this project
- CD to the project
- Run
mvn package
- Find the resulting jar in the target folder
Place the jar produced from above step onto /opt/sonar/extensions/plugins
Run docker-compose up from your docker-sonar image folder
- Create a sonar-project.properties file
- Add the line
sonar.import_unknown_files=true
see the example
- Add the line
- Run sonar-scanner. Make sure to have sonar server is running beforehand.
- Run
sonar-scanner
from project folder - Open Sonar
localhost:9000
on the browser - Place Clojure widget to the dashboard
- Optional: Place Size Metrics widget and resize the dashboard