【问题标题】:Remove all issue checks from tests in SonarQube, except pattern matchers从 SonarQube 中的测试中删除所有问题检查,模式匹配器除外
【发布时间】:2024-07-12 04:55:02
【问题描述】:

我仅针对源代码分析 SonarQube 中的问题。我已经从我的测试中删除了所有问题检查。但是,现在我还想为测试添加模式匹配器规则(IGNORE 标记)。实际规则已经到位。我怎样才能做到这一点?我当前的排除设置是:

Ignore issues on multiple criteria:
    Rule key pattern: *
    File path pattern: test/**/*.*

所以我应该以某种方式编辑“Rule kye 模式:*”是否排除所有规则除了模式匹配器规则?

【问题讨论】:

    标签: sonarqube


    【解决方案1】:

    http://docs.codehaus.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreIssues

    首先,排除test/**/*.* 的所有规则 => Ignore Issues on Multiple Criteria | * | test/**/*.*

    然后,为test/**/*.* 添加此模式匹配器规则 => 限制编码规则范围 | pattern_matcher_rule_id | test/**/*.*

    【讨论】:

      最近更新 更多