Skip to content
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 bug in regexp #1

Open
idnael opened this issue Apr 29, 2019 · 0 comments
Open

fix bug in regexp #1

idnael opened this issue Apr 29, 2019 · 0 comments

Comments

@idnael
Copy link

idnael commented Apr 29, 2019

There is a problem with some rules.

A gitignore pattern ".gradle"
was correctly matching ".gradle" and "app/.gradle"
but was also wrongly matching "build.gradle" and "app/build.gradle"

Other case:
A gitignore pattern "utilities/"
was wrongly matching "src/misc_utilities"

To fix it, in method fnmatch_pathname_to_regex I added a positive lookbehind
in the beginning of the regexp, that will match the string beginning or the "/" character

return r'(?:\A|(?<=/))' + ''.join(res)

I can't do a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant