I just started working with SonarCloud and trying to get pull request comments working.
We build all our projects in docker containers (due to platform dependencies) so we have to use the scanner.
The scanner works great but we are having pathing issues for the comments that get added to our pull request. Our solution and code live in a src directory. But when the comments get posted, it strips off the src so the comment isn’t added to the file/line correctly.
I had this working and started making adjustments to include code coverage information and I broke it.
I tried running the scanner in the root of the project… and in the src folder. nothing seems to solve my issue.
I also tried to provide a sources argument to the scanner but that just causes the scanner to crash because its duplicating the scans.
File .cs can’t be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files
What am I missing here?
Template for a good new topic, formatted with Markdown:
- ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
Azure DevOps - CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
Azure DevOps - Scanner command used when applicable (private details masked)
dotnet sonarscanner begin
/k:"$(sonarCloudProject)"
/o:“marconet”
/d:sonar.host.url=“https://sonarcloud.io”
/d:sonar.login="$(SONARCLOUDLOGINKEY)"
/d:sonar.scm.provider=git
/d:sonar.pullrequest.provider=vsts
/d:sonar.pullrequest.key=$(System.PullRequest.PullRequestId)
/d:sonar.pullrequest.base=$(System.PullRequest.TargetBranch)
/d:sonar.pullrequest.branch=$(System.PullRequest.SourceBranch)
/d:sonar.pullrequest.vsts.instanceUrl=$(System.CollectionUri)
/d:sonar.pullrequest.vsts.project="$(System.TeamProject)"
/d:sonar.pullrequest.vsts.repository="$(Build.Repository.Name)" - Languages of the repository
ASP .Net Core C#/Javascript