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: normalizePath tilde expansion on Windows #656

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

lanvstn
Copy link
Contributor

@lanvstn lanvstn commented Jul 3, 2023

normalizePath sometimes gets backslash paths as input.
In such case it will not be able to act on the ~/ prefix, since it will be \~ instead.
FromSlash will provide the correct variant.

An example where the error happens:

With .vale.ini:

StylesPath = ~/.vale/styles

When running Vale:

The path 'C:\Users\...\Code\~\.vale\styles' does not exist.

The test was wrongly failing after this change. The normalizePath callers tend to provide FromSlash'ed inputs, so the test has been adapted accordingly.

normalizePath sometimes gets backslash paths as input.
In such case it will not be able to act on the ~/ prefix,
since it will be \~ instead. FromSlash will provide the correct variant.
@lanvstn lanvstn force-pushed the normalizePath-windows-tilde branch from 7fb60dc to 613c518 Compare July 3, 2023 13:39
@jdkato jdkato merged commit 27fe2f6 into errata-ai:v2 Jul 4, 2023
@lanvstn lanvstn deleted the normalizePath-windows-tilde branch July 4, 2023 19:09
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.

3 participants