-
Notifications
You must be signed in to change notification settings - Fork 54
Clean up unused code and replace Path with URL to resolve warnings #407
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
Conversation
let versionContainer = try container.nestedContainer( | ||
keyedBy: ToolchainVersionCodingKeys.self, forKey: .version | ||
) | ||
let name = try versionContainer.decode(String.self, forKey: .name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (blocking): I think that the name could be in the decoding stream, even though it is redundant for decoding because it is a synthesized property of ToolchainVersion. I expect that the name will need to be decoded here, even if the return value is thrown away. Some kind of handling of the name key here will also help with symmetry between this init and the encode method above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your feedback.
To clarify, are you expecting the decode to be strict in this context?
I am considering adding:
_ = try versionContainer.decode(String.self, forKey: .name)
This approach ensures that decoding fails if the name is missing, maintaining symmetry with the encode(to:) function, even if the value is not directly used.
Please let me know if this aligns with your intended solution.
praise: Overall this is good code cleanup. There's just one straight forward issue and then I think that this can be merged. |
// Create generation tool arguments. | ||
var generationToolArguments = [ | ||
builtArtifact.path.string, | ||
builtArtifact.url.path(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I’m mistaken, this should be path(percentEncoded: false)
.
See FB20238046 and https://developer.apple.com/forums/thread/784446.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Totally makes sense since we're dealing with file system paths
builtArtifact.url.path(), | ||
"--output-file", | ||
outputFile.string, | ||
outputFile.path(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, percentEncoded: false
should be set here.
…g for subprocess
@belkhadir there were some problems on the main branch that were causing the workflows to fail on pull requests. You'll need to pull the latest from the main branch and incorporate them here in this PR before the workflows can succeed. Once you've done that then I'll run the workflows to perform their checks. |
@belkhadir thank you for your contribution. |
This merge request includes two refactoring:
Path
withURL
to eliminate Xcode warnings and align with recommended API usage.