-
-
Notifications
You must be signed in to change notification settings - Fork 643
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 glob_to_regex #4351
Comments
Hmmmm. I'm pretty sure we have another implementation of this somewhere? We use https://pypi.python.org/pypi/pathspec for this in ProjectTree, for example. And the v2 engine uses the rust impl from https://crates.io/crates/glob |
that's good news. i'll try it out |
Oh, I see what's going on (although I have no idea why we're even trying to match files this way... shouldn't the SourcesField matching be enough?). The implementation needs to escape all regex characters. |
This was added in 8565b63. So the issue here is '$' has to be escaped right? |
It does seem that escaping dollar sign should do the trick.
There are special ones to keep such as **, so it may be good just to do the incremental fix.
I'm on it with #4350 (not ready yet)
… On Mar 21, 2017, at 8:15 AM, JieGhost ***@***.***> wrote:
This was added in ***@***.***
I think this is what sources payload field uses for matching. The old logic uses fnmatch which has issues.
So the issue here is '$' has to be escaped right?
Are there any possible regex chars other than '.' and '$' in filenames?
Or do we want to play safe and exclude everything that is meaningful in regex?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
OK, thanks! |
closed with #4350 |
regex_repo
from https://github.com/wisechengyi/pantsis NOT matching with
in https://github.com/wisechengyi/pants/blob/227aa8c279fa754f0790e405f16839d6920fe990/src/python/pants/source/filespec.py#L11
workaround:
https://github.com/wisechengyi/pants/blob/227aa8c279fa754f0790e405f16839d6920fe990/src/python/pants/source/filespec.py#L49-L50
The text was updated successfully, but these errors were encountered: