-
Notifications
You must be signed in to change notification settings - Fork 621
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
Implement expandGlob() #617
Conversation
146b76a
to
f4cc885
Compare
Regression. The prettier tests will fail until expandGlob() is fixed since they try to match absolute paths outside of CWD.
Should help later when extracting common functionality to expandGlob(), like exclusion. Makes findTestModules() an async generator.
f4cc885
to
4729107
Compare
a2e441f
to
b6af0a7
Compare
Adds an exclude field to ExpandGlopOptions. This should be the final API.
f1d05be
to
de35f8f
Compare
In other words, support path prefixes when specifying excludes. This aligns with the file matchers of the test runner and prettier. It's less redundant since this cannot be achieved efficiently on the client-end.
de35f8f
to
eda4eb3
Compare
437e930
to
9b1b634
Compare
9b1b634
to
a783ffc
Compare
@ry @bartlomieju Ready for review! I've checked that |
@kt3k a review from you would be appreciated if you have the time. |
@nayeemrmn In your description, it says "DON'T MERGE". Please update if it is no longer applicable. |
@ry Fixed! Ready again. |
//fs/README has |
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.
LGTM
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.
LGTM - nice PR @nayeemrmn!
(And thanks for the careful review @kt3k )
@nayeemrmn Can you draft a commit message so I can squash this all up? |
fs/glob.ts: - Improve prototypes for expandGlob() and expandGlobSync() from denoland#604. - Rename glob() to globToRegExp(). - Add normalizeGlob() and joinGlobs(). - Extract GlobToRegExpOptions from GlobOptions, remove the strict and filepath options. fs/globrex.ts: - Add GlobrexOptions. fs/path/constants.ts: - Add SEP_PATTERN. fs/walk.ts: - Add WalkOptions::includeFiles - Default WalkOptions::includeDirs to true. - Don't traverse directories matching a skip pattern. - Remove walkSync()'s default root value. prettier: - Refactor to use expandGlob(). testing: - Make findTestModules() an async generator.
@ry Added an empty commit with the message. |
fs/glob.ts: - Improve prototypes for expandGlob() and expandGlobSync() from denoland/std#604. - Rename glob() to globToRegExp(). - Add normalizeGlob() and joinGlobs(). - Extract GlobToRegExpOptions from GlobOptions, remove the strict and filepath options. fs/globrex.ts: - Add GlobrexOptions. fs/path/constants.ts: - Add SEP_PATTERN. fs/walk.ts: - Add WalkOptions::includeFiles - Default WalkOptions::includeDirs to true. - Don't traverse directories matching a skip pattern. - Remove walkSync()'s default root value. prettier: - Refactor to use expandGlob(). testing: - Make findTestModules() an async generator. Original: denoland/std@8c90bd9
Fixes various minor JSDoc snippet issues.
...properly. Fixes #576.
This had to be done from scratch unless we could utilise
globrex
somehow but I think it can be done by splitting paths and flat-mapping on each segment, applyingglobrex
on individual segments. I also want to give it anexclude
option so excluded directories won't be traversed - callers all want to exclude by path prefix anyway, this is currently done with a hackyg
flag.