-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Stuck if gitignore: true
(probable globby gitignore performance issue)
#365
Comments
I can't think why this should take so much longer unless maybe globby is getting hung on something in your .gitignore? Can you point to a repository that demonstrates the problem, please? |
Sure, https://github.com/LastDragon-ru/lara-asp I'm running it on my dev machine (inside docker) where all deps are installed ( |
Seems
So, until the fix, the workaround is
|
Most of the implementation or .gitignore lives in globby, but I do not see any issues there that sound exactly like this. I won't be able to debug this for a while, but I wonder if the problem goes away if you remove the leading '/' character from those paths in .gitignore? |
Yep, seems also helps. |
Per specification, .gitignore treats paths beginning with slash as being relative to the same directory, but that is unusual and unexpected in my opinion - and also unnecessary because the leading slash can be omitted without changing the meaning. Leaving off the leading slash is what I would recommend, though I will investigate and fix or open a bug against globby if that is appropriate. |
Nope. The |
I had a bit of time to try this. Your scenario seems to behave as expected:
I think you may be encountering a performance issue with the globby implementation where enabling the gitignore option causes it to enumerate the entire directory tree looking for ignore files. Here is the relevant file/pattern in that code: As above, I will open an issue against that project once I produce a standalone demonstration of the problem. For your purposes, you could try to verify this is only a performance issue by clearing out most of the ignored directories and running the original configuration to see if it completes faster. |
Haha, I forgot I had already looked into this some. You should be able to confirm you are seeing very bad performance (but correct behavior) by waiting for the original scenario to complete Your “ignores” workaround may be necessary for now. Relevant thread and especially my comments here: sindresorhus/globby#50 |
gitignore: true
gitignore: true
(probable globby gitignore performance issue)
It finished after ~40min... and results are fine. So seems this is really related to the sindresorhus/globby#50 |
Thanks! I think I will use this issue as a reminder to myself to add an option to use only the root ignore file because that should not cause this problem. |
0.14.0 |
I'm trying to migrate to
cli2
, but seems.gitignore
processing somehow different from incli
:cli2
just stuck if I setgitignore: true
in.markdownlint-cli2.yaml
:( Thenpx markdownlint-cli --ignore-path=.gitignore
it used now, and it is very fast.My test command is:
This
.markdownlint-cli2.yaml
will workThis is not (waited for ~5min):
Am I doing something wrong or this is a bug?
PS: markdownlint-cli2 v0.13.0 (markdownlint v0.34.0)
The text was updated successfully, but these errors were encountered: