Skip to content

Fix global schema lookup on Windows#36

Open
AJDurant wants to merge 1 commit into
JulianCataldo:masterfrom
AJDurant:patch-1
Open

Fix global schema lookup on Windows#36
AJDurant wants to merge 1 commit into
JulianCataldo:masterfrom
AJDurant:patch-1

Conversation

@AJDurant

Copy link
Copy Markdown

When using the glob match ./dir/*.md on Windows, it gets transformed to dir\\*.md by the path normalization.

minimatch specifically says not to use \ or \\ as these are easy to mess up escaping, and the above transformation does not match when you would expect it to.

The solution is to always use / for the glob, or to ignore the escapes on Windows with the windowsPathsNoEscape option. https://github.com/isaacs/minimatch?tab=readme-ov-file#windows

Given the normalization is needed for sorting out relative paths, using the windowsPathsNoEscape option makes most sense. I've tested this locally.

When using the glob match `./dir/*.md` on Windows, it gets transformed to `dir\\*.md` by the path normalization.

minimatch specifically says not to use `\` or `\\` as these are easy to mess up escaping, and the above transformation does not match when you would expect it to.

The solution is to always use `/` for the glob, or to ignore the escapes on Windows with the `windowsPathsNoEscape` option. https://github.com/isaacs/minimatch?tab=readme-ov-file#windows

Given the normalization is needed for sorting out relative paths, using the `windowsPathsNoEscape` option makes most sense. I've tested this locally.
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

Successfully merging this pull request may close these issues.

1 participant