This is the docker engine we use at Codacy to run SonarC# developed by SonarSource.
You can also create a docker to integrate the tool and language of your choice! Check the Docs section for more information.
Requirements:
apt-get install libxml2-utilsapk add libxml2-utilsdotnet-runtime, dotnet-host and dotnet-targeting-pack) - the .NET Core SDKThis seems to be more or less working in vscode, install the
"C# for Visual Studio Code (powered by OmniSharp)" extension
and before opening the project in it do make configure.
make configure - runs dotnet restore which downloads all the required libraries for the projects to work.make build - compiles the Analyzer project.make build-docs - compiles the DocsGenerator project.make build-all - compiles both the Analyzer and DocsGenerator projects.make documentation - downloads upstream rules for the sonar version we defined in Analyzer.csproj,
extracts the rules for that version and runs the DocsGenerator application.See other useful targets inside the Makefile.
docker build -t codacy-sonar-csharp:local .docker run --user=docker --rm -v <PATH-TO-CODE>:/src:ro -v <PATH-TO>/.codacyrc:/.codacyrc:ro codacy-sonar-csharp:localdocker run --user=docker --rm -v <PATH-TO-CODE>:/src:ro -v <PATH-TO>/.codacyrc:/.codacyrc:ro -it --entrypoint /bin/sh codacy-sonar-csharp:localMake sure all the volumes mounted have the right permissions for user
docker
Currently, to use your own configuration file, you must add a SonarLint.xml xml file with an AnalysisInput structure inside.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<AnalysisInput>
<Rules>
<Rule>
<Key>S103</Key>
<Parameters>
<Parameter>
<Key>maximumLineLength</Key>
<Value>24</Value>
</Parameter>
</Parameters>
</Rule>
</Rules>
</AnalysisInput>
Tool Developer Guide
Tool Developer Guide - Using Scala
We use the codacy-plugins-test to test our external tools integration. You can follow the instructions there to make sure your tool is working as expected.
Codacy is an Automated Code Review Tool that monitors your technical debt, helps you improve your code quality, teaches best practices to your developers, and helps you save time in Code Reviews.
Codacy also helps keep track of Code Coverage, Code Duplication, and Code Complexity.
Codacy supports PHP, Python, Ruby, Java, JavaScript, and Scala, among others.
Codacy is free for Open Source projects.