[Bug]: xcprojformatter prints redundant/non-helpful information after a decode failure
还没有人认领这个 Issue。
评估
调研方向
可复现的情况是 xcprojformatter --update 命令;从 Sources/ 下该工具的主入口开始,这里是捕获 decode 错误的位置,也是打印 usage/help 块的位置,并查看 help 是否由共享的错误处理路径输出。运行复现(删除 "name": "Main" 行,然后重新运行 --update)以确认。完成意味着只打印 Missing required value for key "name" at "/targets[0]",在 decode 失败时抑制 help 文本,但仍可通过显式调用获得。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Swift
- 星标
- 544
- 派生
- 36
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apple/xcode-project-format 的其他 Issue
-
Negative encoding value crashes the decoder可能已有人在做 @nassersala 于 58 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
-
[Bug]: Decoder does not restore the parent value after decoding a child可能已有人在做 @hippi345 于 31 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 88/100
-
[Feature]:未关闭enhancement
难度 5/5 一周以上 新手友好度 20/100
-
Xcode未关闭enhancement
难度 5/5 一周以上 新手友好度 25/100
-
[Feature]:未关闭enhancement
难度 1/5 1 小时以内 新手友好度 15/100
查看 apple/xcode-project-format 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
OneBusAway/onebusaway-ios#1749 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1 小时以内 新手友好度 62/100