[Feature]: Add "verify" option to xcprojformatter
还没有人认领这个 Issue。
评估
调研方向
Start by reading the xcprojformatter command-line entry point and the existing --update implementation to see how it reads and formats a project file. Then check how CLI options and command tests are organized. Done means a verify option or subcommand reports success for canonical input and fails for input that formatting would change; the issue leaves the failure output format open.
由索引模型根据 Issue 内容生成。
描述
Describe the feature
Add a new option to xcprojformatter that "verifies" an .xcproj file. If the file is already in the canonical format (i.e. the file is unaffected by running xcprojformatter --update project.xcproj), the command succeeds; if the file is not in the canonical format (the file is modified by running xcprojformatter --update project.xcproj) the command fails.
This could either be a new flag, such as xcprojformatter --verify --input project.xcproj, or a new subcommand, xcprojformatter verify --input project.xcproj.
In its simplest form, a failing verification simply fails with no output. A more user-friendly version would give some sort of output to indicate what part of the file that is not in the canonical format.
Use case
Having a verify option is great in CI pipelines for Xcode projects. With it, one could enforce in PRs that the .xcproj file is not modified such that it's no longer in the canonical format. This is similar to how swift format lint can be used for source code, including Package.swift.
Alternatives considered
It is possible to do this manually, by running xcprojformatter --input <...> --output <...> and comparing the files. However, it would be natural if the cli provided this out-of-the-box.
Additional context
No response
- 主要语言
- Swift
- 星标
- 544
- 派生
- 36
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apple/xcode-project-format 的其他 Issue
-
[Bug]: xcprojformatter prints redundant/non-helpful information after a decode failure可能已有人在做 @akhil9tiet 于 1 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 70/100
apple/xcode-project-format#27 · 1 条评论 ·
-
Negative encoding value crashes the decoder可能已有人在做 @nassersala 于 60 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
-
[Bug]: Decoder does not restore the parent value after decoding a child可能已有人在做 @hippi345 于 32 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 88/100
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
-
question
难度 1/5 1 小时以内 新手友好度 35/100
apple/xcode-project-format#19 · 4 条评论 · 1 个 reaction ·
查看 apple/xcode-project-format 的全部 Issue
相似的 Issue
-
mac
难度 2/5 1-3 小时 新手友好度 64/100
VictorKildahl/cra#487 · 1 条评论 ·
维护者通常 1 天内回复
-
Update CI Config未关闭
难度 1/5 1 小时以内 新手友好度 64/100
ashfurrow/Nimble-Snapshots#316 ·
-
难度 2/5 1-3 小时 新手友好度 67/100
-
area: performance
难度 2/5 1-3 小时 新手友好度 76/100
manaflow-ai/cmux#44791 · 1 条评论 ·
维护者通常 1 天内回复
-
priority: p2 type: bug type: docs
难度 2/5 1-3 小时 新手友好度 84/100
googleapis/google-cloud-swift#1641 ·
维护者通常 1 天内回复