Safer check for source code options in Project Cracker#758
Merged
dsyme merged 3 commits intofsharp:masterfrom Apr 19, 2017
Merged
Safer check for source code options in Project Cracker#758dsyme merged 3 commits intofsharp:masterfrom
dsyme merged 3 commits intofsharp:masterfrom
Conversation
Current test fails on for example, --ws:"Bundle" (a WebSharper 4.x setting)
dsyme
reviewed
Apr 19, 2017
|
|
||
| let sourceFiles, otherOptions = | ||
| opts.Options |> Array.partition (fun x -> Path.GetExtension(x).ToLower() = ".fs") | ||
| opts.Options |> Array.partition (fun x -> x.IndexOfAny(Path.GetInvalidPathChars()) = -1 && Path.GetExtension(x).ToLower() = ".fs") |
Contributor
There was a problem hiding this comment.
Looks like you can use not (FileSystem.IsInvalidPathShim(x)) like this https://github.com/Microsoft/visualfsharp/blob/379f729dca9f310b474e3edf0669c71fe39b0129/src/fsharp/vs/IncrementalBuild.fs#L1612
Contributor
There was a problem hiding this comment.
I fixed this with a direct edit to the PR
Contributor
There was a problem hiding this comment.
Actually what you had was right - this code is not part of the compiler DLL itself
Contributor
Author
There was a problem hiding this comment.
Ah, that looks cleaner but that part of the code base seems quite independent. Thanks for the fast review.
cgravill
added a commit
to cgravill/TypesTSFS
that referenced
this pull request
May 3, 2017
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.
The partitioning is looking for ".fs" as an extension but this can throw exceptions. This can happen on settings that aren't paths and therefore may contain invalid path characters e.g. --ws:"Bundle" (a WebSharper 4.x setting).