fix: normalize path separators for Windows compatibility#693
Open
thomaslaich wants to merge 1 commit intonumtide:mainfrom
Open
fix: normalize path separators for Windows compatibility#693thomaslaich wants to merge 1 commit intonumtide:mainfrom
thomaslaich wants to merge 1 commit intonumtide:mainfrom
Conversation
thomaslaich
commented
Apr 21, 2026
| } | ||
|
|
||
| func pathMatches(path string, globs []glob.Glob) bool { | ||
| path = strings.ReplaceAll(path, "\\", "/") |
Author
There was a problem hiding this comment.
should i use filepath.ToSlash(path) instead?
Member
There was a problem hiding this comment.
Yeah I think this is the better approach.
Member
|
Thanks for the contribution. I'd like to support Windows but I haven't used it in any kind of serious way in over a decade which is why we currently don't have any releases setup for it. Getting some windows CI setup has been on my task list for a long time now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows, file paths use backslashes (
\) as separators. Thegobwas/globlibrary expects forward slashes, so glob matching would silently fail for all Windows paths. This fix normalizes backslashes to forward slashes in pathMatches before matching, making formatter glob patterns work correctly on Windows. Tested on Windows 11.By the way: It seems like the library is not officially released on Windows. We use pixi and download
treefmtfromconda-forgewhich has for some reason a win-64 binary available.