-
Notifications
You must be signed in to change notification settings - Fork 139
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
Windows swift-format Support (#213) #219
Closed
Closed
Conversation
This file contains 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
Add support to the CI to test the swift-format (official) based linting on Windows.
Ignore any swap files written out by vim. This helps anyone who may use vim as an editor.
This new function is similar to `run` except that it requires that the arguments be passed properly quoted and pre-split through an array. It also will not permit the prefixing a command for execution. The major difference between `run` and `execute` is that `execute` will not go through a shell, so parameter expansion, variable substitution, etc do not occur. Additionally, because there is no shell involved, a single process is created rather than two processes (one for the shell, and the actual process being invoked). This is required to enable using this action on Windows, where the process redirection does not work as the shell used is different.
Use the newly minted `execute` to directly execute the `git` process. This should be a slight bit faster as no new shell process needs to be setup.
This adds a second path of execution specifically for Windows. The second path is required due to changes in how the action can be used. In particular: - `prefix` cannot be supported as we do not go through a shell - `args` is currently unsupported as the style must be different In order to regain the ability add supplementary arguments with execute, the `args` parameter must change from a string to an array of strings.
`cat` is a common utility on Unix systems, however, it is not universally available. On Windows systems, resort to `cmd` (%COMSPEC%) as the shell interpreter is guaranteed to be present. It stands to reason that `sh` would be a viable alternative to `cat` as that is the default (POSIX) shell interpreter on Unix systems and should be present on any SuS or POSIX complaint system.
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.
Thank you for your contribution to this project! A stale label has been added to this pull request because it has been open 45 days with no activity. To keep this PR open, add a comment or push a commit within 10 days. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This is an amalgamation of all the various changes which can be reviewed individually. This however should hopefully repair #213.