Refactor: one shared YAML/frontmatter helper instead of five hand-rolled line parsers

Aperta
#132 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, yaml
Ambito
tooling

Direzione di ricerca

Start by reading the five named scripts and the existing test_canon_sync.py pattern to understand their parsers and how scripts are kept self-contained. Check the setup scripts' PyYAML dependency and compare current parsing behavior against the requested edge cases. Done means a shared helper is vendored consistently, duplicate keys and top-level keys are handled as specified, and the edge-case tests cover the listed YAML and encoding cases.

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

Descrizione

Describe your idea

Replace the line-by-line YAML parsing in validate-module.py, quick_validate.py, run_triggers.py, scaffold-standalone-module.py and scan-path-standards.py with one shared helper, e.g. bmad_yaml.py with load_frontmatter() / load_module_yaml().

Why is this needed?

Each script parses YAML differently, and each gets a different subset wrong: block scalars (>, >-, |+), quoted values, nested keys leaking to top level, duplicate keys, BOMs. Several open and newly filed bugs share this root cause (#117 plus the validate-module, run_triggers, scaffold-standalone-module and quick_validate reports). PyYAML is already a PEP 723 dependency of the setup scripts.

How should it work?

  • yaml.safe_load when available, with the current line parser kept as a documented fallback.
  • Top-level keys only for validation, utf-8-sig decoding, and duplicate keys reported rather than last-wins.
  • One test file covering the edge-case table (folded, literal, chomping indicators, quoted, nested, BOM, CRLF).
  • Vendored into each skill's scripts/ (skills must stay self-contained), with a sync test like test_canon_sync.py.

PR

Happy to help implement this if the direction is agreed.

Lingua principale
Python
Stelle
220
Fork
54
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 bmad-code-org/bmad-builder

Tutte le issue di bmad-code-org/bmad-builder

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.