最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to specify wildcards in sonar-project.properties - Stack Overflow

programmeradmin7浏览0评论

I am trying to use SonarQube to scan the UI modules I have. The UI modules are lot in number. They have a common structure. Each module has its own JS files.

I need to specify the sonar.sources value to match all JS files in my project. Is it possible to do something like this?

sonar.sources=\*/*/script
sonar.language=js

I used these. But, I got an error saying something like "unable to resolve path". Can someone help?

I am trying to use SonarQube to scan the UI modules I have. The UI modules are lot in number. They have a common structure. Each module has its own JS files.

I need to specify the sonar.sources value to match all JS files in my project. Is it possible to do something like this?

sonar.sources=\*/*/script
sonar.language=js

I used these. But, I got an error saying something like "unable to resolve path". Can someone help?

Share Improve this question edited May 19, 2020 at 14:43 Mig82 5,4804 gold badges45 silver badges70 bronze badges asked Jun 19, 2015 at 4:16 IamSanIamSan 1651 gold badge1 silver badge6 bronze badges 1
  • 1 check the last section here - docs.sonarqube.org/display/SONAR/Narrowing+the+Focus it has some examples – Techtwaddle Commented Jun 19, 2015 at 9:12
Add a comment  | 

3 Answers 3

Reset to default 13

Try to use wildcard :

*   Match zero or more characters
**  Match zero or more directories
?   Match a single character

Like this:

sonar.sources=**/script

Update

As of 2019, the sonar.sources parameter doesn't support such glob patterns. The common practice is to set this value to a list of directories that contain source code. The scanner will find traverse the directory trees and run applicable analyzers (JavaScript analyzers will consume .js files, Python analyzers will consume .py files, and so on.)

Thanks all. I used sonar.sources=. in my properties file. This properties file is sitting next to my modules. So, now SonarQube takes into account all the folders next to this file, and scans for the specified file extensions. It works now.

sonar.sources does not currently support wildcard at all. This cannot be done.

发布评论

评论列表(0)

  1. 暂无评论