Make the device scripts answer --help and refuse bad flags
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 90/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
調査の方向性
まず scripts/devices/validate.test.mjs と scripts/devices/table.test.mjs の CLI テストを確認し、次に各スクリプトのヘッダーコメントにある使用方法の行と main() 関数を読みます。ヘルプ、不明なフラグ、値の不足をカバーするテストを追加し、一時的なドキュメントファイルを使って、無効なテーブル引数を渡してもファイルが変更されないことを確認します。node --test scripts/devices/*.test.mjs を実行し、validate.mjs が引き続きワークフローの --event、--github-output、--comment 引数を受け付けることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Why
docs/devices.md tells people to check a report with node scripts/devices/validate.mjs report.json, but --help makes that script try to open a file named --help, and table.mjs rewrites docs/devices.md when given a flag it doesn't know. ROADMAP.md, Now: the Device lab.
What to do
Today:
node scripts/devices/validate.mjs --helpprintsENOENT: no such file or directory, open '--help'.node scripts/devices/table.mjsignores flags it doesn't know, so--helpor a typo like--chekrewrites docs/devices.md instead of checking it, and--datawith no folder after it writes a table with no reports.
- Test first, in
scripts/devices/validate.test.mjsandscripts/devices/table.test.mjs, which already run the scripts withexecFileSync:--helpand-hprint the usage and exit 0, for both scripts;table.mjswith an unknown flag, or with--dataor--docand no value after it, prints the usage, exits 1 and leaves the doc unchanged. Use a temporary doc file, as the existing CLI test does.
- In each script's
main(), handle--helpand-hfirst, then refuse unknown arguments and flags with no value. Reuse the usage lines from each file's header comment.
Done when
- The new tests pass, and every existing test in
scripts/devices/still passes. validate.mjsbehaves exactly as before when called the way.github/workflows/device-report.ymlcalls it:--event,--github-outputand--comment.
How to check
node --test scripts/devices/*.test.mjs
node scripts/devices/validate.mjs --help
node scripts/devices/table.mjs --check
Keep in mind
validate.mjsruns on public issues. It reads the issue as data and runs nothing from it. Keep it that way, and never print a report's values in an error.- Don't run
node scripts/devices/table.mjswithout--checkon your branch unless you mean to rewrite the table. - Node built-ins only. No new dependency.
- 主要言語
- TypeScript
- スター
- 11
- フォーク
- 0
- 平均マージ
- 10分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DojoCodingLabs/hermit のほかの issue
-
docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
DojoCodingLabs/hermit#73 ·
メンテナーはふだん 1 日以内に返信
-
device-lab
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
DojoCodingLabs/hermit#45 ·
メンテナーはふだん 1 日以内に返信
-
device-lab
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
DojoCodingLabs/hermit#44 ·
メンテナーはふだん 1 日以内に返信
-
device-lab
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DojoCodingLabs/hermit#43 ·
メンテナーはふだん 1 日以内に返信
-
agent-friendly docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
DojoCodingLabs/hermit#39 ·
メンテナーはふだん 1 日以内に返信
DojoCodingLabs/hermit の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
superlinked/sie#1033 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
remix-run/react-router#15838 ·
メンテナーはふだん 1 日以内に返信
-
area/ci bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
melgarafael/DeskcommCRM#5290 ·
メンテナーはふだん 1 日以内に返信