kucherenko / jscpd

Copy/paste detector for programming source code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"pattern" takes precedence over "ignore"

FFdhorkin opened this issue · comments

Describe the bug
If pattern is specified and has overlap with ignore, then ignore doesn't work properly.

To Reproduce
Config file:

{
    "pattern": "./reactCommon/**/*",
    "ignore": [
        "**/node_modules/**/*",
        "**/.next/**/*"
    ]
}

Then run npx jspcd

If I rename my config file and run npx jscpd --ignore "**/node_modules/**/*,**/.next/**/*", then it behaves as expected
Similarly, npx jscpd --pattern "./reactCommon/**/*" --ignore "**/node_modules/**/*,**/.next/**/*" triggers the problem

Expected behavior
the ./reactCommon/.next folder should be ignored

Actual behavior
I get a lot of dupe warnings for lines in the ./reactCommon/.next folder

Screenshots
image

Desktop (please complete the following information):

  • OS: WSL2 Ubuntu
  • OS Version: Ubuntu 22.04.2 LTS
  • NodeJS Version: v18.16.1
  • jscpd version: 3.5.9

Additional context
Note that the same behavior seems to occur no matter how I format the ignore line (i.e. use a full relative path, omit ** or *, etc) or whether I use a string or array of strings

thank you, will take a look

Any chance there might be traction on this in the future?