Sonar Dotnet is an Visual Studio Code extensions that helps you detect and fix quality issues as you write code in C#.
Open the Command Palette and search Sonar Dotnet.
- Set your desired path in terminal
- Select Sonar Dotnet: Lint in Command Palette
Result:
- Execute dotnet build command
Result:
Once configured in the project it is no longer necessary to run the lint again.
- The Sonar Dotnet needs a .NET Core 2.0+.
- Install tool dotnet-sonarscanner.
dotnet tool install --global dotnet-sonarscanner
Configure organizationKey, token and serverUrl properties in user settings:
Field organizationKey and serverUrl is optional. Server url default is SonarCloud: https://sonarcloud.io.
{
"sonar-dotnet-vscode.connection.sonar": {
"organizationKey": "<myOrganizationKey>",
"token": "<myToken>",
"serverUrl": "<myServerUrl>"
}
}
Configure project key in configuration file .vscode/settings.json.
{
"sonar-dotnet-vscode.connection.project": {
"projectKey": "<myProjectKey>"
}
}
See the CHANGELOG for more information.
Licensed under the MIT.