[Bug]: xcprojformatter prints redundant/non-helpful information after a decode failure

オープン 初心者向け
#27 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
swift
領域
cli

調査の方向性

再現可能なケースは xcprojformatter --update コマンドです。ツールのメインエントリポイントである Sources/ 配下で、decode エラーが捕捉され、usage/help ブロックが出力される箇所から始め、help が共有のエラーハンドリング経路によって出力されているかどうかを確認してください。再現を実行して確認します("name": "Main" 行を削除してから、--update を再実行します)。完了条件は、Missing required value for key "name" at "/targets[0]" だけが出力され、decode 失敗時には help テキストが抑制されるものの、明示的な呼び出しでは引き続き利用できることです。

索引モデルが issue の本文から書いたものです。

説明

bug
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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apple/xcode-project-format のほかの issue

apple/xcode-project-format の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。