-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add support to expand glob patterns #211
Open
sebastien-rosset
wants to merge
28
commits into
get-woke:main
Choose a base branch
from
CiscoM31:glob-expansion
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sebastien-rosset
force-pushed
the
glob-expansion
branch
from
June 28, 2022 19:18
c32f4fe
to
4cc10d8
Compare
What do you think about adding support for double star operator using one of the libraries listed here: https://www.client9.com/golang-globs-and-the-double-star-glob-operator/ |
sebastien-rosset
force-pushed
the
glob-expansion
branch
6 times, most recently
from
June 30, 2022 23:19
55f50f4
to
80f9b24
Compare
sebastien-rosset
force-pushed
the
glob-expansion
branch
from
July 5, 2022 22:04
033e655
to
1205c1c
Compare
Codecov Report
@@ Coverage Diff @@
## main #211 +/- ##
==========================================
+ Coverage 93.76% 93.82% +0.06%
==========================================
Files 23 23
Lines 818 826 +8
==========================================
+ Hits 767 775 +8
Misses 30 30
Partials 21 21
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
woke
. Support double star expansion.What is the current behavior? (You can also link to an open issue here)
woke
parses all files recursively.usage.md
file indicates file globs can be used, but in reality glob patterns are not expanded by woke. Glob pattern expansion may be performed by a invoking shell, not by woke itself.If users want to perform glob expansion, they must perform glob expansion before before invoking
woke
, such as invokingwoke
from a shell.What is the new behavior (if this is a feature change)?
When command-line arguments include a glob pattern,
woke
expands the glob pattern. The following special terms in the patterns are supported:*
/**/
?
[class]
{alt1,...}
Does this PR introduce a breaking change? (What changes might users need to make due to this PR?)
A subtle problem could occur in the corner case when you want to match a file that includes the wildcard characters (e.g.
*
and?
).Before this change,
woke '*.go'
would look for a file named*.go
(without the wildcard expansion) becausewoke
wasn't expanding glob patterns.After this change,
woke '*.go'
would cause wildcard expansion. If you really want to match a file named*.go
, either don't use wildcard or escape the wildcard, e.g.woke '\*.go'
.Other information:
To support double star expansion, there is a dependency on https://github.com/bmatcuk/doublestar.