feat(builtins): add xcodebuild builtin formatted by xcbeautify #2009
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.46) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 477 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.369
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2009"
general
weight: 0.35
jdx
Adds
Builtins.xcodebuild, which builds or tests an Xcode scheme and formats the output with xcbeautify. Requested in https://github.com/jdx/hk/discussions/2008.It is named for
xcodebuildbecause xcbeautify only formats output piped into it.This runs
xcodebuild -scheme 'MyApp' 'build' 2>&1 | xcbeautifywhen a Swift, C-family or Xcode project file is selected. A failed build fails the step (pipefail).| Option | Default | Meaning |
| --- | --- | --- |
|
scheme| none, required | scheme to build ||
action|"build"| for example"test"||
destination| unset | value for-destination||
extra_args|List()| morexcodebuildarguments, such as-workspace||
xcbeautify_args|List()| arguments forxcbeautify|scheme, the config still loads andhk validateaccepts it; the step fails when it runs, withset scheme on Builtins.xcodebuild. A load-time error isn't possible today: hk's Pkl evaluator drops a command that reads an unset property, and raises athroweven when a config sets the property.xcodebuildcomes with Xcode, so the step needs macOS.hk initdoes not auto-detect this builtin, since it can't know the scheme.bash.Validation
test/builtin_xcodebuild.batscovers option quoting, failure propagation and the missing-scheme error using stand-inxcodebuildandxcbeautifyscripts. It has not been run against a real Xcode project or the real xcbeautify, so the builtin has nohk testcases.cargo testpasses. Locally, "builtins tests run" has 11 failures inrubocop,rubocop_server,standard_rbandgh_actions_lock, which this change doesn't touch.AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.
🤖 Generated with Claude Code
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Documentation
Documented the
xcodebuildbuiltin, including its required scheme, configurable build options, and macOS requirement.Clarified when builds run and documented support for
xcbeautifyarguments.Tests
Added coverage for build option handling, including argument order, error-code reporting, and behavior when a scheme is missing.
Verified that a missing scheme does not produce beautified output.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->