All files excluded by the scm ignore settings

Dear Sonar Source team,

We have a rather big project, which we try to analyze using SonarCloud after Travis build.

If we set (SonarCloud->Project->Administration->SCM) Disable the SCM Sensor to False (default value, SCM sensor is active), all files are excluded by the scm ignore settings (link). We did not fill any textfield in the Administration->Analysis scope, as we use include/exclude rules at the level of the file.

If we disable the SCM Sensor, all files are properly analyzed (link), but that results in PR not being decorated (PR is properly analyzed, but the status is not reported back to GitHub because of the missing SHA)

With enabled SCM sensor, changed files are correctly detected, but eventually they are ignored by the scm ignore settings

We tried to manually set git as SCM, and GitHub and repository identifier in Administration->Pull Request, but it did not help.

Why are we getting the ‘excluded by the scm ignore settings’ message? Where can we set it?


P.S. Recently we changed the repository directory structure, as a way to resolve our previous issue. It might be somehow related.

The problem is probably somewhere at the level of sonarcloud plugin interpreting the .gitignore file.
Maybe it doesn’t understand pattern negation.

If I enable SCM and set sonar.scm.exclusions.disabled=true, files are properly analyzed, and status is reported back to GitHub.


So the problem was really on our side. The negation pattern didn’t work as expected and was indeed ignoring the whole folder that was supposed to be versioned.

Please consider this issue closed.

1 Like

Just to chime in here regarding negation patterns, I’m having a similar issue. The very end of my .gitignore file has lines with negative patterns in it (to ensure no files are ignored incorrectly). This works perfectly with Git itself, but when I run Sonar locally, it still excludes the files matched by those negative patterns from the analysis.