Add a `--check` mode that compares a config with the enums in source

Aperta
#15 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à
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js
Ambito
tooling

Direzione di ricerca

Start with bin/validate-config.js and src/scan.js to see how config validation and source scanning work; then read the CLI tests in test/cli.test.js. Run the verification command from the issue and add cases for enums without blocks and blocks without source enums. Done when --check <dir> reports both mismatches, preserves config-only checks and uses the existing exit codes; document the option in README.md.

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

Descrizione

enhancement wave

Context

The validator checks a config in isolation. It cannot tell you that a config allocates a block to an enum no file defines, or that a file defines an enum no block covers. That comparison is the missing half of the workflow.

Scope

  • bin/validate-config.js
  • src/scan.js
  • test/cli.test.js
  • README.md

Acceptance criteria

  • --check <dir> scans the directory and compares enum names with the config.
  • An enum in source with no block is an error.
  • A block with no enum in source is an error.
  • The existing config-only checks still run.
  • Exit codes stay 0, 1 and 2.

Verification

node bin/validate-config.js codepact.config.json --check contracts/

Complexity

Large (1-2 days)

Part of Stellar Wave. Comment to claim this issue before starting.

Lingua principale
JavaScript
Stelle
0
Fork
1
Merge medio
14h 38m
PR unite (30g)
9

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 codepacct/codepact-conventions

Tutte le issue di codepacct/codepact-conventions

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.