如何在 sonar-project.properties 中指定通配符 [英] How to specify wildcards in sonar-project.properties

查看:79
本文介绍了如何在 sonar-project.properties 中指定通配符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 SonarQube 扫描我拥有的 UI 模块.UI 模块的数量很多.它们具有共同的结构.每个模块都有自己的 JS 文件.

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.

我需要指定 sonar.sources 值来匹配我项目中的所有 JS 文件.有可能做这样的事情吗?

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?

推荐答案

尝试使用通配符:

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

像这样:

sonar.sources=**/script

更新

截至 2019 年,sonar.sources 参数不支持此类 glob 模式.通常的做法是将此值设置为包含源代码的目录 列表.扫描器将遍历目录树并运行适用的分析器(JavaScript 分析器将使用 .js 文件,Python 分析器将使用 .py 文件,依此类推.)

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.)

这篇关于如何在 sonar-project.properties 中指定通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆