Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#2,231 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
90/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
tooling

Direzione di ricerca

Inizia da crates/registry-bregctl/src/module_lock_patch.rs, in particolare da patch_module_locks e key_value_end, poi leggi i test unitari in quel file. Verifica dove si trova item.end per una voce finale e per una voce seguita da una riga vuota. Aggiungi test per entrambi i casi; il lavoro è terminato quando il digest resta associato alla sua voce e la riga vuota prima della successiva chiave di primo livello viene mantenuta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
2
Fork
0
Merge medio
9h 24m
PR unite (30g)
271

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di registrystack/registry-stack

Tutte le issue di registrystack/registry-stack

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.