code-metrics yaml_subset.py: quote mid-value swallows comments; duplicate key in a sequence item reports the wrong line
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
2つのバグは plugins/code-metrics/scripts/yaml_subset.py にあり、1つはコメント除去のロジック(引用符が文字列を開始する箇所)、もう1つはシーケンス項目の重複キーチェックです。commit 1d5a3fca3f で修正された plugins/user-experience/scripts/lib/yaml-subset.mjs の JavaScript 版は想定される動作を示しており、そのテストは plugins/user-experience/tests/yaml-subset.test.mjs にあります。まず title: it's fine # comment と、重複キーを含む - job: a の入力に対して失敗する Python テストを書いてください。両方が問題を再現し、修正後に両方が通り、既存の yaml_subset.py のテストもすべて通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
No related issue: found while porting the parser for #6306 (PR #6669).
Problem
plugins/code-metrics/scripts/yaml_subset.py likely has two bugs that its JavaScript port in plugins/user-experience/scripts/lib/yaml-subset.mjs had and fixed in #6669:
- A quote mid-value swallows a trailing comment.
stripCommenttreats any'or"as the start of a quoted string, even inside a plain value, sotitle: it's fine # commentparses as"it's fine # comment"instead of"it's fine". - A duplicate key inside a sequence item is reported on the wrong line. For
- job: a\n id: x\n job: b\n, the error names line 1 (the dash line) instead of line 3.
The port fixed both in 1d5a3fca3f: a quote opens only where a value starts (line start, after : , - , [ or ,), and the sequence item's first key is passed into the mapping so the duplicate check fires on its own line. See the tests "quotes and comments in plain values" and "a duplicate key in a sequence-item mapping is reported on its own line" in plugins/user-experience/tests/yaml-subset.test.mjs.
Unverified against the Python: confirm each with a failing test first.
Acceptance criteria
- A failing test reproduces each bug against
yaml_subset.py, then passes after the fix. - Existing
yaml_subset.pytests still pass.
- 主要言語
- Shell
- スター
- 22
- フォーク
- 2
- 平均マージ
- 8時間 34分
- マージ済み PR(30日)
- 946
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
melodic-software/claude-code-plugins のほかの issue
-
needs-human needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
melodic-software/claude-code-plugins#7636 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
agent-ready needs-human
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
melodic-software/claude-code-plugins#7598 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
good first issue priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
melodic-software/claude-code-plugins#7530 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs-human priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
melodic-software/claude-code-plugins#7455 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
melodic-software/claude-code-plugins#7351 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
melodic-software/claude-code-plugins の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
collabnix/awesome-mcp-lists#225 ·
メンテナーはふだん 9 日以内に返信
-
good first issue
難易度 2/5 半日 初心者へのやさしさ 88/100
-
documentation needs-triage priority:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
yeongseon/azure-functions-validation-python#546 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
edoardottt/awesome-hacker-search-engines#371 ·
メンテナーはふだん 3 日以内に返信
-
bug cli libc sev-5
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100