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

fix: removes trailing /* from --ignore-glob #879

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wllfaria
Copy link
Contributor

@wllfaria wllfaria commented Mar 5, 2024

This PR removes trailing / or /* and should fix #865.

Where globs ending with those patterns would not match any directory, as the default listing doesn't include an ending /.

As mentioned here, the pattern generated by a glob that ends either in / or /*, such as node_modules/* or node_modules/* would not match as the default listing of directories don't include those characters.

Description

I added a line at that goes as follows:

let input = input.trim_end_matches("/*").trim_end_matches('/');

Removing both patterns when they exists at the end of the glob. Here is a screenshot of it working:

image

How Has This Been Tested?

Should I write new unit tests for this specific case?

@massivebird
Copy link

These changes do not appear to solve the linked issue. The issue's author is looking for the ability to ignore files inside some subdirectory without ignoring the subdirectory itself. This behavior appears to be missing from these changes.

@wllfaria
Copy link
Contributor Author

wllfaria commented Mar 7, 2024

@massivebird you're absolutely right, I'll consider how to implement this in a good way

@AliSananS
Copy link

@massivebird You are correct, knowing if node_modules directory exist is useful but not what's inside this. 😂

@wllfaria
Copy link
Contributor Author

Ill add some comments on the issue, about explorations I did to fix this problem. Its not as straightforward as it may seem

@wllfaria wllfaria force-pushed the main branch 3 times, most recently from 4eacca5 to 0e0b4cb Compare March 11, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

Bug: Not Ignoring Subdirectories in directories
3 participants