SonarQube - 使用通配符忽略所有 xml 文件 [英] SonarQube - Using wildcards to ignore all xml files

查看:39
本文介绍了SonarQube - 使用通配符忽略所有 xml 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 SonarQube 的通配符用法感到困惑.假设我想忽略所有 xml 文件.我应该把 *.xml 放在 Global Source File Exclusions 中吗?但它会忽略不同层中的xml文件,例如/foo/bar/file.xml/foo/bar/folder/folder2/xml?

I have confused on SonarQube's wildcards usage. Say I want to ignore all xml files. Should I just put *.xml in the Global Source File Exclusions? But will it ignore xml files in different layers, for instance /foo/bar/file.xml and /foo/bar/folder/folder2/xml?

推荐答案

在您的 sonar-project.properties 中,您有两种方法可以忽略文件:

In your sonar-project.properties, you have two ways to ignore files:

  • sonar.exclusions=the/full/path/*.xml 将忽略 path 中的所有 .xml 文件.
  • sonar.exclusions=**/*.xml 将忽略您所在文件夹和子文件夹中的所有 .xml 文件.
  • sonar.exclusions=the/full/path/*.xml will ignore all .xml files in path.
  • sonar.exclusions=**/*.xml will ignore all .xml files in the folder and sub-folders where you are.

以下是不同的通配符:

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

您可以在 声纳文档中找到更多信息

You can find more information on Sonar Documentation

这篇关于SonarQube - 使用通配符忽略所有 xml 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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