-
Notifications
You must be signed in to change notification settings - Fork 39
feat: Make Target.metadata mutable and mark Target.prune as deprecated
#275
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,8 @@ public struct RunAction: Equatable, Codable, Sendable { | |
| public let expandVariableFromTarget: TargetReference? | ||
| public let launchStyle: LaunchStyle | ||
| public let appClipInvocationURL: URL? | ||
| public var customWorkingDirectory: AbsolutePath? | ||
| public var useCustomWorkingDirectory: Bool | ||
|
|
||
| // MARK: - Init | ||
|
|
||
|
|
@@ -35,7 +37,9 @@ public struct RunAction: Equatable, Codable, Sendable { | |
| metalOptions: MetalOptions? = nil, | ||
| expandVariableFromTarget: TargetReference? = nil, | ||
| launchStyle: LaunchStyle = .automatically, | ||
| appClipInvocationURL: URL? = nil | ||
| appClipInvocationURL: URL? = nil, | ||
| customWorkingDirectory: AbsolutePath? = nil, | ||
| useCustomWorkingDirectory: Bool = false | ||
|
Comment on lines
+40
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Guard against invalid state when enabling custom working directory without a path Ensure we don’t end up with Add a precondition at the beginning of the initializer body: precondition(
!useCustomWorkingDirectory || customWorkingDirectory != nil,
"useCustomWorkingDirectory requires customWorkingDirectory to be non-nil"
)🤖 Prompt for AI Agents |
||
| ) { | ||
| self.configurationName = configurationName | ||
| self.attachDebugger = attachDebugger | ||
|
|
@@ -51,6 +55,8 @@ public struct RunAction: Equatable, Codable, Sendable { | |
| self.expandVariableFromTarget = expandVariableFromTarget | ||
| self.launchStyle = launchStyle | ||
| self.appClipInvocationURL = appClipInvocationURL | ||
| self.customWorkingDirectory = customWorkingDirectory | ||
| self.useCustomWorkingDirectory = useCustomWorkingDirectory | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -76,7 +82,9 @@ public struct RunAction: Equatable, Codable, Sendable { | |
| ), | ||
| expandVariableFromTarget: TargetReference? = nil, | ||
| launchStyle: LaunchStyle = .automatically, | ||
| appClipInvocationURL: URL? = nil | ||
| appClipInvocationURL: URL? = nil, | ||
| customWorkingDirectory: AbsolutePath? = nil, | ||
| useCustomWorkingDirectory: Bool = false | ||
| ) -> RunAction { | ||
| RunAction( | ||
| configurationName: configurationName, | ||
|
|
@@ -92,7 +100,9 @@ public struct RunAction: Equatable, Codable, Sendable { | |
| metalOptions: metalOptions, | ||
| expandVariableFromTarget: expandVariableFromTarget, | ||
| launchStyle: launchStyle, | ||
| appClipInvocationURL: appClipInvocationURL | ||
| appClipInvocationURL: appClipInvocationURL, | ||
| customWorkingDirectory: customWorkingDirectory, | ||
| useCustomWorkingDirectory: useCustomWorkingDirectory | ||
| ) | ||
| } | ||
| } | ||
|
|
||
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.
Default
useCustomWorkingDirectoryto avoid breaking Decodable; consider restricting external mutationAdding a non-optional Bool without a default breaks backward Decoding when the key is absent. Also consider limiting write access to maintain invariants.
Apply this diff to make Decoding backward-compatible and reduce external mutation risks:
📝 Committable suggestion
🤖 Prompt for AI Agents