SonarCloud Main Branch Analysis

Hello! I’ve set Coverage Exclusions on one of my projects like so:

It works great on pull request analysis - excluded path is not taken to scope of analysis. But when main branch analysis starts I get an error of too much lines in analysis, as if exclusion doesn’t work there. Can i exclude paths for main branch analysis?

Hey there.

Coverage exclusions only exclude code from the calculation of Code Coverage (whether or not code has been covered by tests).

Source File Exclusions (scroll down) will exclude files from analysis overall. You might also prefer to set sonar.sources and sonar.tests in a sonar-project.properties file or as analysis parameters to your sonar-scanner command. See the documentation on Analysis Scope for more details.