There are many ways you can contribute to the SonarScanner for .NET project, some very easy and others more involved. We want to be friendly and welcoming to all potential contributors, so we ask that everyone involved abide by some simple guidelines outlined in our Code of Conduct.
One of the easiest ways to contribute is to participate in discussions and discuss issues on our Community Forum.
Even if you plan to implement a new rule or fix one by yourself and then submit it back to the community, please start by creating a new thread on our Community Forum to get some early feedback on this idea.
When working with Eclipse or IntelliJ please follow the sonar guidelines
To submit a contribution:
- Make sure an issue exists in this repository. Otherwise, create an issue to describe the necessity of the change.
- Create a pull request in this repository and link it to the issue it solves (
Fixes #...
).
Please make sure that you follow our code style.
Before submitting the PR, make sure all tests are passing (all checks must be green).
-
If you are Sonar internal you need to set these environment variables:
ARTIFACTORY_USER
: your repox.jfrog username (see e.g.orchestrator.properties
)ARTIFACTORY_PASSWORD
: the identity token for repox.jfrog
-
If you are an external contributor you'll have to delete the
NuGet.config
file.
You can run the Unit Tests via the Test Explorer of Visual Studio.
- Go to
PATH_TO_CLONED_REPOSITORY
- Run
powershell
- Run
.\scripts\its-build.ps1
- Open the
PATH_TO_CLONED_REPOSITORY\its
directory using your favorite IDE for Java (e.g. IntelliJ IDEA Community Edition) - Run the ITs
In order to be able to run the ITs for SonarCloud the following environment variables need to be set:
- SONARCLOUD_URL
- SONARCLOUD_ORGANIZATION
- SONARCLOUD_PROJECT_KEY
- SONARCLOUD_PROJECT_TOKEN
In our CI/CD pipeline, we use the following:
- SONARCLOUD_URL=https://sc-staging.io
- SONARCLOUD_ORGANIZATION=team-lang-dotnet
- SONARCLOUD_PROJECT_KEY=team-lang-dotnet_incremental-pr-analysis
- SONARCLOUD_PROJECT_TOKEN=[user-token]
These can be set either on the operating system or your preferred IDE test run configuration.