【问题标题】:Codacy yaml configuration to ignore duplication in test filesCodacy yaml 配置以忽略测试文件中的重复
【发布时间】:2018-08-14 13:28:01
【问题描述】:

我想从我的测试文件中排除重复检查,但其他一切都保持不变。

这是我的.codacy.yml 文件:

duplication:
  enabled: true
  exclude_paths:
    - 'test/**'
    - '**.test.js'

但我仍然在测试文件中报告了所有重复项。

有人知道怎么做吗?

编辑根据我尝试的以下建议:

engines:
  duplication:
    enabled: true
    exclude_paths:
      - 'test/**'
      - '**.test.js'

我也试过不带引号:

engines:
  duplication:
    enabled: true
    exclude_paths:
      - test/**
      - '**.test.js'

还是没有骰子:(

【问题讨论】:

  • 我刚遇到这个问题,它帮助了我。它适用于我们的 Android 项目。唯一的区别是我做了- '**/test/**'

标签: yaml codacy


【解决方案1】:

您的配置文件中似乎缺少应用复制配置所需的 engines 属性。

您应该将配置文件更改为如下所示:

engines:
  duplication:
    enabled: true
    exclude_paths:
      - 'test/**'
      - '**.test.js'

【讨论】:

    【解决方案2】:

    您的配置文件似乎有误。

    查看文档:

    应该是这样的:

    engines:
      duplication:
        enabled: true
        exclude_paths:
          - 'test/**'
          - '**.test.js'
    

    【讨论】:

    • 我首先尝试过,但它也没有工作,在引擎下进行全局设置有点没有意义?我现在再试一次。
    • 没有用。它仍然在测试文件中报告重复:(
    • 这很奇怪。您应该在应用支持中联系 Codacy,以便他们可以更好地解释问题。请分享您的发现
    猜你喜欢
    • 2020-11-29
    • 1970-01-01
    • 2019-07-16
    • 1970-01-01
    • 2018-05-19
    • 2016-02-25
    • 2019-11-14
    • 2012-10-31
    • 2016-05-31
    相关资源
    最近更新 更多