Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Properties file exclude multiple paths

Tags:

I have a sonar-project.properties file, which specifies how sonar-runner inspects the the folder structure, which files to inspect, which files to ignore etc.

I cannot successfully determine however how to exclude multiple paths successfully.

Here is the sonar-project.properties file:

sonar.projectKey=C3S-web sonar.projectName=C3S-sonar-web sonar.projectVersion=0.0.1  sonar.sources=. sonar.tests=test sonar.language=js sonar.profile=Sonar way sonar.exclusions=test/*, node_modules/* sonar.dynamicAnalysis=reuseReports  sonar.javascript.jstest.reportsPath=coverage sonar.javascript.lcov.reportPath=coverage/lcov-report 

the line I am having trouble with is:

sonar.exclusions 

listing multiple paths does not work, with or without a comma, or in quotes either.

like image 703
Jon Duffy Avatar asked Jun 10 '15 10:06

Jon Duffy


People also ask

How do you exclude from the analysis with sonar exclusions property?

Choosing Files To specify which files are are and are not included in an analysis go to Administration > General Settings > Analysis Scope > Files. Use exclusion to analyze everything but the specified files: sonar. exclusions - to exclude source code files.

How do you exclude rules in SonarQube?

In Java, we can exclude Sonar checks using the built-in @SuppressWarnings annotation. This works exactly the same way as suppressing compiler warnings. All we have to do is specify the rule identifier, in this case java:S106.


1 Answers

You have to use the double asterisk pattern to recursively exclude all sub-folders and files:

sonar.exclusions=test/**, node_modules/** 

A single asterisk matches only the files on that specific folder (no recursion).

like image 181
Pedro Penna Avatar answered Sep 18 '22 00:09

Pedro Penna