1

I'd like to exclude the duplication check from my test files, but leave everything else the same.

This is my .codacy.yml file:

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

But I still get all duplications reported in test files.

Anyone knows how to accomplish this?

EDIT Based on below suggestions I tried:

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

And I tried without the quotes as well:

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

Still no dice :(

Predrag Stojadinović
  • 3,439
  • 6
  • 34
  • 52
  • 1
    I just came across this question and it helped me. It worked for our Android project. The only difference was that I did `- '**/test/**'`. – tasomaniac Dec 29 '20 at 15:18

2 Answers2

6

You seem to be missing the engines property on your configuration file that is required for the duplication configuration to be applied.

You should change your configuration file to look like this:

engines:
  duplication:
    enabled: true
    exclude_paths:
      - 'test/**'
      - '**.test.js'
mrfyda
  • 61
  • 1
  • 2
0

your config file seems wrong.

Check the docs at:

should be something like:

engines:
  duplication:
    enabled: true
    exclude_paths:
      - 'test/**'
      - '**.test.js'
pedrorijo91
  • 7,635
  • 9
  • 44
  • 82