-
Notifications
You must be signed in to change notification settings - Fork 131
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: .gitignored dirs should be excluded from workspace, pedanticPackages should handle gitignore patterns with leading slash #1222
Conversation
If this change is contentious for any reason I can revert it - something that's been bothering me about bleeding spago is that it walks gitignored dirs looking for workspace members, including |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good - could you add the repro as a test?
It should go in the Pedantic suite, but should use the new copyTree
structure from the more recent tests (it's shorter and nicer to work with, we haven't managed to refactor the old tests yet)
But after the latest changes we shouldn't be walking any directories that are being gitignored? Or what am I missing here? |
Sorry! To clarify, the partial gitignore change both significantly improves performance when large node_modules is present and aligns with the behavior I'd expect of not looking for source packages in gitignored dirs. If scanning gitignored dirs for packages is desired though I can revert that change :) |
I think my previous fix, for not respecting a gitignore in case we are explicitly looking for something which would be ignored (like .spago), was too coarse grained. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarifications! This looks great now 🙂
@f-f Gentle bump on this, I'm not sure why actions thinks the macos task has been running for 16 days when it has clearly finished 😝 |
rebased onto master |
Thanks for the ping! I was waiting for CI to be done then forgot to check on it, sorry 🥲 |
Description of the change
Fixes a bug with the globbing changes introduced in
56a36d5
where a.gitignore
pattern of/.spago
causes spago to (incorrectly) ignore.spago
when building the module dependency graph.This is felt when building with
--pedantic-packages
, but I imagine it probably causes some other issues, too.This is caused by some subtle micromatch behavior differences compared with the previous globbing strategy:
Reproduce with
Checklist:
README
P.S.: the above checks are not compulsory to get a change merged, so you may skip them. However, taking care of them will result in less work for the maintainers and will be much appreciated 😊