You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: xcprojformatter prints redundant/non-helpful information after a decode failure #27
The help text doesn't help you fix the problem that the project wasn't able to be decoded, so it shouldn't print. Only Missing required value for key “name” at “/targets[0]” should print.
Steps to reproduce
$ xcrun xcodeproj init template.xcodeproj
$ xcrun xcodeproj target add Main --product-type application
...
$ xcrun xcprojformatter --update template.xcodeproj
# add a structural issue
$ sed -i '' '/^ *"name": "Main",$/d' /tmp/xc2/template.xcodeproj/project.xcproj
$ xcrun xcprojformatter --update template.xcodeproj
Missing required value for key “name” at “/targets[0]”
----------------------------
The xcprojformatter tool pretty prints 'project.xcproj' Xcode project files in their canonical format.
Usage:
xcprojformatter [[--input] input-project] [--output output-project]
...
Hit this same issue on main (0a7242a). Right now Sources/Tool/main.swift wraps everything in one do/catch, so decode and file errors end up printing the separator and full --help text too.
Since there wasn't a PR open for it yet, I put up a fix in #31 that separates Arguments parsing into its own do/catch and adds a few tests for decode and file errors. Let me know if you'd prefer anything formatted differently on stderr.
Activity
akhil9tiet commentedon Nov 15, 2026
I'd like to work on this — please assign it to me.
zachshallbetter commentedon Nov 24, 2026
Hit this same issue on
main(0a7242a). Right nowSources/Tool/main.swiftwraps everything in onedo/catch, so decode and file errors end up printing the separator and full--helptext too.Since there wasn't a PR open for it yet, I put up a fix in #31 that separates
Argumentsparsing into its owndo/catchand adds a few tests for decode and file errors. Let me know if you'd prefer anything formatted differently onstderr.