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

Removed "hasMagic" check before escaping paths. #4931

Merged
merged 3 commits into from
Sep 13, 2020

Conversation

theodab
Copy link
Contributor

@theodab theodab commented Sep 9, 2020

Which issue, if any, is this issue related to?

Closes #4193

Is there anything in the PR that needs further explanation?

Globby's "hasMagic" function, which is meant to detect if a path
contains globbing characters, notably does not detect paths that
contain matched parentheses, unless those matched parentheses
have extra globbing characters attached to them. This is a problem
because globby requires matches parentheses to be escaped, if they
are part of the literal path.
This changes the part of the code that escapes paths that literally
exist to not check "hasMagic" first, to get around that oversight.
I'm not super knowledgeable about your codebase, so if you think this solution might break something somewhere else, feel free to request changes.

theodab and others added 3 commits September 2, 2020 14:14
Globby's "hasMagic" function, which is meant to detect if a path
contains globbing characters, notably does not detect paths that
contain matched parentheses, unless those matched parentheses
have extra globbing characters attached to them. This is a problem
because globby requires matches parentheses to be escaped, if they
are part of the literal path.
This changes the part of the code that escapes paths that literally
exist to not check "hasMagic" first, to get around that oversight.
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theodab Thanks!

(2nd approval here: #4923 (comment))

@jeddy3 jeddy3 merged commit 1dfd78b into stylelint:master Sep 13, 2020
@jeddy3
Copy link
Member

jeddy3 commented Sep 13, 2020

  • Fixed: use of full file path without converting it to glob (#4931).

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

Successfully merging this pull request may close these issues.

Allow to use full file path without converting it to glob
3 participants