-
Notifications
You must be signed in to change notification settings - Fork 14
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
Increase richness of glob syntax? #3
Comments
The idea is to take all paths returned by If this isn't something |
I'm hesitant to implement this as you suggest since I've been careful not to inspect the strings passed to This might be achieved by using the |
My thought isn't to use this (EDIT: |
I'm not sure it is possible to manually add glob-patterns to It is possible to use ignore, but it would still require using |
While the top level API of |
Oh, I see, I'll look into it |
I can't seem to make gitignore work with the existing API, and tbh I don't have much time to work on it right now. Good day, :) |
Oh, I was assuming I would until it sounded like you were going to jump on it. It might be a few days. |
No worries, take your time :)
…On Thu, Apr 19, 2018, 20:03 Ed Page ***@***.***> wrote:
Oh, I was assuming I would until it sounded like you were going to jump on
it. It might be a few days.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABRx0wkCAdhLG8Qe8uihUihY1w0QK47dks5tqMNNgaJpZM4TTxEP>
.
|
I see two general options for using ignore
How do you feel about changing the API? Any preference on route? |
I'd rather take the second option. Maybe it's possible to replace the @killercup I'd love to hear your 0.016€ (as of 21:10 19/04/2018 UTC) |
So in looking at the different APIs and considering the trade offs, here are some random thoughts:
I personally lean towards I didn't even realize |
Yes, the GlobWalk API was changed to mirror that of glob's. I agree in that the base case of "iterate from CWD" is unlikely and probably a bad practice. Saying that, I'd rather we keep enough of the current API to be mostly a drop in replacement for glob. I wouldn't mind for a change as long as the freestanding |
Except a drop-in replacement for |
I've just realised I'm making no sense. It's possible the have |
@Gilnaa, I think I can even spare 0.019 CHF, I still have some from RustFest. I'm a huge fan of the pattern syntax used in .gitignore files, which is also becoming more popular in other areas like file search in editors. I'm not sure I get your discussion on glob-crate-like-API instead of a base path argument? Having a |
In preparing my change, do you mind if its re-formatted with rustfmt 1.25 (dedicated commit, of course)? Or should I disable my editors auto-formatting? |
This change switches `globwalk` from basic glob syntax to using gitignore syntax. Benefits include - Excluding content from being walked using `!` - Controlling for depth with a leading `/` Fixes Gilnaa#3 BREAKING CHANGES: - API: `GlobWalk::new` and `GlobWalk::from_patterns` now accept the `base_dir` parameter again. - Syntax: Some characters are now reserved for gitignore syntax.
I'm working on a file system stager to help make lay out packages. Currently I'm using
globwalk
for a way to grab files by pattern.In stager, I want to add exclusion support. I can add exclusions as an additional field but I got thinking, why not use gitignore syntax?
Example:
["*.rs", "!/tests/**/*.rs"]
would find all rust source except in a test directory.The text was updated successfully, but these errors were encountered: