0

I am having a bit of an issue with excluding auto-generated files when using MSbuild runner.

Each file that is auto generate has within. I have gone into sonarQube setting for project and set the "Ignore Issues on Files" to =

.*<auto-generated>.*

the job builds using msbuild but doesn't ignore files and still calls out issues.

It's driving me mad!!!

1 Answers1

0
  1. The match on exclusions is performed on a full file path so you'd better set sonar.exclusions=**/.*auto-generated.*. That will guarantee that file matching auto-generated in ANY directory will be ignored. (Note: I don't know if the <>are part of your desired regexp or not. See http://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-patterns on the usage of patterns.

  2. Where/How did you set the exclusions to avoid scanning auto generated files ?

The simplest way is to pass this exclusion to the MSBuild Runner (Begin) command line with option /d:"sonar.exclusions=.*auto-generated.*"

Olivier Korach
  • 281
  • 1
  • 4