To pass a SonarQube.Analysis.xml file, you’ll need to pass /s:<custom.analysis.xml> to the dotnet sonarscanner command.
You can, alternatively, just pass your exclusion directly to the scanner command (it will still be checked into version control)! dotnet sonarscanner end /d:sonar.exclusions=<your_exclusion>
To change the rules applied to your project, you cannot use a .editorconfig file. You must change the Quality Profile applied to your project to one not including these rules.
Now I’m starting the Sonar scan like this: dotnet sonarscanner begin /k:mu88_Project28 /o:mu88 /d:sonar.login=${{ secrets.SONAR_TOKEN }} /d:sonar.host.url=https://sonarcloud.io /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /s:SonarQube.Analysis.xml
Which immediately fails with:
SonarScanner for MSBuild 5.9.1
Using the .NET Core version of the Scanner for MSBuild
Loading analysis properties from /home/runner/work/Project28/Project28/SonarQube.Analysis.xml
Unable to read the analysis settings file '/home/runner/work/Project28/Project28/SonarQube.Analysis.xml'. Please fix the content of this file.
Error: Process completed with exit code 1.
How can I configure the Quality Profile from my Git repository? I don’t want to change anything in the UI manually. And .editorconfig seems to get included, because it seems to work for S3925.
With regard to your Quality Profile, if this works (using an .editorconfig file) – it’s not officially supported, which might be why you see inconsistent behavior. The Quality Profile should be configured within the SonarCloud UI, as documented.
Hi, Colin,
We are the new one for Sonar Cloud. There are some HTML rule that we want to exclude it. But in your link, I can find “Quality Profiles” page. But I cannot find any “Copy” button or icon or feature. Could you guide me how to find it?