We started to use SonarCloud with Bitbucket cloud. For build server we use Windows Server VM, because some of the projects are still .net framework.
Recently I added new project in VB.Net, .NET 4.8, created pipeline:
- '& $env:SONAR_PATH begin /o:"xxx" /k:"xxx" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login=$env:SONAR_TOKEN'
- .\xxx\.nuget\nuget.exe restore '.\xxx\xxx.sln'
- '& $env:MSBUILD_PATH ".\xxx\xxx.sln" -t:Rebuild -p:Configuration=Release'
- '& $env:SONAR_PATH end /d:sonar.login=$env:SONAR_TOKEN'
Where SONAR_PATH is “E:\Sonar\SonarScanner.MSBuild.exe”, version SonarScanner 4.6.2.2472
In test project we have huge json files with fake data. I wanted to exclude them, so in Administration → General Settings → Analysis Scope I have added Source File Exclusion: “**/*.json”
Unfortunatelly it is not working. Tried adding direct path to the biggest json file - also no luck. What is strange, it works for css files.
Below is part of the log downloaded from bitbucket, looks like configuration is loaded properly.
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: **/build-wrapper-dump.json, **/xxx.Business.Tests/Data/**, **/xxx/Scripts/polyfil/**/*, **/xxx/Scripts/test/**/*, **/xxx/Scripts/tests/**/*, **/xxx/Scripts/SyncFusion/**/*, **/xxx/Scripts/jquery*, **/xxx/Scripts/knockout*, **/xxx/Scripts/boostrap*, **/xxx/Scripts/moment*, **/xxx/Content/sass/**, **/*.css, **/*.json, xxx.Business.Tests/Data/CustomJson/bigfile.json
How can I force SonarCloud to ignore these json files?