feat(editor): add --bulk-validate to run every format's validator across a tree

Recursively walks a directory, peeks each file's 4-byte magic to
identify the format, derives the per-format --validate-X flag
from the format table's --info-X entry, and invokes that
validator as a subprocess for each file. Reports total / passed
/ failed / skipped counts and lists the failure paths with their
exit codes; returns exit 1 if any failure is found.

For each failure it prints the exact follow-up command needed to
reproduce the detailed error message, so the user doesn't have
to remember which validator goes with which extension. Asset-
style formats with no validator (.wom / .wob / .whm world
geometry) are counted in the "skipped" bucket but don't fail
the run.

Composes with the existing audit/fix tooling:
  --audit-tree dir          # find header-level breakage
  --magic-fix dir --apply   # auto-fix ext/magic mismatches
  --bulk-validate dir       # run every per-format validator
  # then re-run --validate-X on individual failures for detail

This is the 12th cross-format utility — depth-checking that
catches per-format semantic errors (duplicate ids, invalid
enums, contradictory flag combos, dangling cross-refs) that
--audit-tree's header-only scan can't see. CLI flag count
950 -> 951.
This commit is contained in:
Kelsi 2026-05-09 22:19:09 -07:00
parent 9318b6c006
commit f606edc4c9
6 changed files with 208 additions and 1 deletions

View file

@ -1369,6 +1369,8 @@ void printUsage(const char* argv0) {
std::printf(" Walk directory recursively and flag corrupted/misnamed Wowee files: too-small, unknown-magic, ext/magic mismatch, magic-without-ext, truncated headers. Exit 1 on any issue\n");
std::printf(" --magic-fix <dir> [--apply] [--json]\n");
std::printf(" Auto-rename files whose extension doesn't match their magic to the canonical extension. Default is dry-run; pass --apply to commit. Skips collisions where the target already exists. Natural follow-up to --audit-tree\n");
std::printf(" --bulk-validate <dir> [--json]\n");
std::printf(" Recursively run each format's --validate-X validator across every recognized .w* file. Reports per-file pass/fail counts; lists failure paths. Asset formats with no validator are skipped. Exit 1 if any failure\n");
std::printf(" --gen-animations <wani-base> [name]\n");
std::printf(" Emit .wani starter: 5 essential animations (Stand / Walk / Run / Death / AttackUnarmed) with fallback chains\n");
std::printf(" --gen-animations-combat <wani-base> [name]\n");