Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pattern" takes precedence over "ignore" #604

Open
FFdhorkin opened this issue Aug 15, 2023 · 2 comments
Open

"pattern" takes precedence over "ignore" #604

FFdhorkin opened this issue Aug 15, 2023 · 2 comments

Comments

@FFdhorkin
Copy link

FFdhorkin commented Aug 15, 2023

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

@kucherenko
Copy link
Owner

thank you, will take a look

@FFdhorkin
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants