[Bug]: xcprojformatter prints redundant/non-helpful information after a decode failure
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
The reproducible case is the xcprojformatter --update command; start in the tool's main entry point under Sources/ where the decode error is caught and where the usage/help block is printed, and see whether the help is emitted by a shared error-handling path. Run the reproduction (delete the "name": "Main" line, then re-run --update) to confirm. Done means only Missing required value for key "name" at "/targets[0]" prints, with the help text suppressed on decode failure but still available via explicit invocation.
Written by the indexing model from the issue text.
Description
Describe the bug
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]
...
Expected behavior
No help text.
- Dominant language
- Swift
- Stars
- 544
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apple/xcode-project-format
-
Negative encoding value crashes the decoderPossibly taken @nassersala claimed this 59 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
[Bug]: Decoder does not restore the parent value after decoding a childPossibly taken @hippi345 claimed this 31 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
[Feature]:Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
XcodeOpenenhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
[Feature]:Openenhancement
Difficulty 1/5 Under an hour Newbie friendliness 15/100
All issues in apple/xcode-project-format
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OneBusAway/onebusaway-ios#1749 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Crash when searching subtitles with the assrt provider (force unwrap of nil in AssrtSubtitle.swift)Openbug: crash feature: subtitle
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 Under an hour Newbie friendliness 62/100