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

bug: Incorrect .gitignore parsing? #651

Open
maxpatiiuk opened this issue Jun 22, 2024 · 1 comment
Open

bug: Incorrect .gitignore parsing? #651

maxpatiiuk opened this issue Jun 22, 2024 · 1 comment

Comments

@maxpatiiuk
Copy link

This line has no impact as it's result is not assigned back to any variable:

ignore.map((pattern) => pattern.replace('!', ''));

Perharps it should be return ignore.map((pattern) => pattern.replace('!', '')); instead?

@maxpatiiuk
Copy link
Author

Also, it seems like .gitignore patterns like /.git/** and detectClones's ignore pattern like .git/** are not working.
.gitignores .git/** and detectClones's ignore pattern **/.git/** is working though.

Seems to be because fast-glob is being called with a pattern like /Users/maxpatiiuk/site/python/specify7/**/*
That causes it to interpret every relative path ignore pattern to be relative to /, rather than process.cwd()
Solutions:

  • jscpd should either provide the cwd option to fast-glob instead of putting cwd into the "pattern"
  • OR, jscpd should prepend every relative path with options.path

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

1 participant