Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

code-metrics yaml_subset.py: quote mid-value swallows comments; duplicate key in a sequence item reports the wrong line

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

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

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 の本文から書いたものです。

説明

good first issue needs-triage priority: low

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:

  1. A quote mid-value swallows a trailing comment. stripComment treats any ' or " as the start of a quoted string, even inside a plain value, so title: it's fine # comment parses as "it's fine # comment" instead of "it's fine".
  2. 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.py tests still pass.
主要言語
Shell
スター
22
フォーク
2
平均マージ
8時間 34分
マージ済み PR(30日)
946

環境構築

はじめの一歩

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

melodic-software/claude-code-plugins のほかの issue

melodic-software/claude-code-plugins の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

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

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