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

bregctl: project lock adds a missing digest after the entry's trailing blank line

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

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

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

評価

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

調査の方向性

crates/registry-bregctl/src/module_lock_patch.rsから始め、特にpatch_module_locksとkey_value_endを確認し、その後このファイルのユニットテストを読みます。最後のエントリの場合と、エントリの後に空行がある場合に、item.endがどこを指すかを確認します。両方のケースのテストを追加します。digestがそのエントリと一緒に保たれ、次のトップレベルキーの前の空行が保持されれば完了です。

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

説明

area:breg bug

When a modules[] entry has no digest yet, bregctl project lock adds one at the end of the
entry. If the entry ends with a blank line (the usual spacing before the next top-level key),
the digest goes after the blank line, so the entry is split by a blank line. The YAML is still
valid and check accepts it, so this is cosmetic, but the lock is meant to be a minimal patch that
leaves the author's layout alone.

Minimal repro, a registry.yaml with:

modules:
  - id: inspections
    version: 0.1.0

evidenceProviders:
  # ...

After bregctl project lock <project>:

modules:
  - id: inspections
    version: 0.1.0

    digest: "sha256:..."
evidenceProviders:
  # ...

Expected:

modules:
  - id: inspections
    version: 0.1.0
    digest: "sha256:..."

evidenceProviders:
  # ...

Likely fix: in crates/registry-bregctl/src/module_lock_patch.rs, patch_module_locks inserts a
missing digest at item.end (around line 131). For the last entry that is the end of the
modules block, which key_value_end (line 230) places after blank lines; for an earlier entry
it is the next entry's first line, so a blank line between entries has the same effect. Inserting
after the last non-blank line of the item fixes both.

Tests: unit tests in the same file (mod tests, line 249): one for the last entry followed by a
blank line and a top-level key, one for a blank line between two entries.

主要言語
Rust
スター
2
フォーク
0
平均マージ
10時間 32分
マージ済み PR(30日)
269

環境構築

はじめの一歩

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

registrystack/registry-stack のほかの issue

registrystack/registry-stack の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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