Repository navigation
Conversation
Every builder now returns Command.Diagnostics: findings about the step's additional
options, each ending with the fix ("Remove it." or "Use <corrected form> instead.").
This commit adds the framework and the parser's findings:
- MalformedOption: an argument xcodebuild refuses (an empty argument, "-sdk macosx"
quoted as one, a lone dash, "-only-testing:" with no value, a bare word from an unquoted
value with spaces, a value flag at the end);
- SuspiciousUserDefault: an option xcodebuild silently ignores ("-destination
generic/platform=iOS" quoted as one argument, -ENABLE_BITCODE=NO for a build setting).
The message says today's build runs without it, and offers removing it or the corrected
form, which applies it.
Corrected forms are rendered with go-shellquote's Join, the inverse of the step's split.
Options.Diagnostics gives a step the parser's findings before its first xcodebuild call.
Validation decides what a builder does with findings: Warn (default) passes everything
through and reports; Fail returns the first one that is not informational as an error.
Nothing changes on the command line.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 9, 2026
lpusok
added this pull request to stack #365
October 9, 2026 12:56
lpusok
marked this pull request as ready for review
October 9, 2026 12:57
There was a problem hiding this comment.
🟡 Changes recommended
Corrective messages mishandle tab-separated flags, and the package documentation overstates action-level validation.
2 open findings
What changed in this PR
Adds parser diagnostics for malformed or suspicious xcodebuild_options, with configurable warning or failure behavior.
Changes:
- Adds diagnostics and validation APIs to assembled commands.
- Detects malformed options and suspicious user defaults with corrective messages.
- Adds diagnostic and validation tests while suppressing duplicate package-resolution diagnostics.
| File | Description |
|---|---|
xcodecommand/xcodecommand.go |
Updates package documentation. |
xcodecommand/resolve_package_deps.go |
Documents diagnostic suppression. |
xcodecommand/resolve_package_deps_test.go |
Verifies diagnostics remain empty. |
xcodecommand/options.go |
Documents parser diagnostics. |
xcodecommand/options_test.go |
Tests diagnostic classification. |
xcodecommand/export.go |
Adds export validation configuration. |
xcodecommand/diagnostic.go |
Implements diagnostics and validation. |
xcodecommand/diagnostic_test.go |
Tests messages, validation, and quoting. |
xcodecommand/command.go |
Stores diagnostics and enforces validation. |
xcodecommand/build.go |
Adds validation to build actions. |
xcodecommand/archive.go |
Adds archive validation configuration. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+119
to
+120
| flag, value, _ := strings.Cut(arg, " ") | ||
| value = strings.Trim(strings.TrimSpace(value), "'\"") |
Comment on lines
+5
to
+6
| // checked against the action and laid over the derived flags; findings surface as | ||
| // Command.Diagnostics and, under Fail validation, as an error. Runner and its |
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.


Every builder now returns Command.Diagnostics: findings about the step's additional
options, each ending with the fix ("Remove it." or "Use instead.").
This commit adds the framework and the parser's findings:
quoted as one, a lone dash, "-only-testing:" with no value, a bare word from an unquoted
value with spaces, a value flag at the end);
generic/platform=iOS" quoted as one argument, -ENABLE_BITCODE=NO for a build setting).
The message says today's build runs without it, and offers removing it or the corrected
form, which applies it.
Corrected forms are rendered with go-shellquote's Join, the inverse of the step's split.
Options.Diagnostics gives a step the parser's findings before its first xcodebuild call.
Validation decides what a builder does with findings: Warn (default) passes everything
through and reports; Fail returns the first one that is not informational as an error.
Nothing changes on the command line.
🤖 Generated with Claude Code