Use slash to allow testing on Windows#215
Open
compnerd wants to merge 3 commits intowearerequired:masterfrom
Open
Use slash to allow testing on Windows#215compnerd wants to merge 3 commits intowearerequired:masterfrom
compnerd wants to merge 3 commits intowearerequired:masterfrom
Conversation
This removes the trailing `,` to allow the warnings to be listed similarly. This is purely a stylistic change intended to help simplify future changes.
When testing on Windows, the tool currently prints paths with a `/` path separator rather than the canonical `\` separator for the platform. The resulting path is valid and usable. However, this causes match failures due to the difference in the path separator. The `slash` module permits us to normalize the path for the tests. This should have no impact when running on Unix platforms, but allows greater portability to Windows.
Add a dependency on slash for development purposes.
Contributor
Author
|
@ocean90 I cannot figure out what the lint issue here is. Could you please help me understand what is going on here? |
Member
|
|
ocean90
reviewed
May 11, 2021
| "file1.swift", | ||
| )}:7:1: warning: [Indentation] replace leading whitespace with 2 spaces`; | ||
| const warning4 = `${join(dir, "file1.swift")}:7:23: warning: [Spacing]: add 1 space`; | ||
| const warning1 = `${slash(join(dir, "file2.swift"))}:2:22: warning: [DoNotUseSemicolons]: remove ';'`; |
Member
There was a problem hiding this comment.
Is there a specific reason why we can't use joinDoubleBackslash()?
Contributor
Author
There was a problem hiding this comment.
Yes, joinDoubleBackslash will replace \ with \\. This will replace \ and \\ with /. They are preforming different operations. This is needed because the tooling currently prints out the path with / as the path separator on Windows rather than the canonical \.
Christian-Oleson
approved these changes
Jul 14, 2023
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.
Normalize the paths to the expected value on Windows when running
swift-format. This has no bearing on the action itself, just is a clean up required to get tests to work on Windows.