如何禁用特定文件的声纳规则? [英] How to disable Sonar rules for specific files?

查看:21
本文介绍了如何禁用特定文件的声纳规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在处理的项目,其中一些文件违反了一些规则,但在某种程度上并不是真正的问题,因此会分散注意力.但是,我不想在全局范围内禁用这些规则,也不想将它们一一标记为误报.

I've got a project I'm working on and some of the files violate some of the rules, but in ways that are not real issues, and are thus distracting noise. However, I don't want to disable these rules globally, and I would prefer not to have to mark 'em as false positives one by one.

有没有办法禁用特定文件的声纳规则,如果可以,如何?

Is there a way to disable Sonar rules for specific files, and if so, how?

推荐答案

从SonarQube 4.0开始,你可以定义问题排除模式 基于规则键和文件路径模式.

Since SonarQube 4.0, you can define issue exclusion patterns based on rule key and file path pattern.

在以前的版本中,您可以依赖关闭违规插件.

On previous versions, you can rely upon the Switch Off Violations plugin.

这篇关于如何禁用特定文件的声纳规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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