The corpus runner checks parser, analyzer, and indexing behavior across many .ws files.
It is designed for local WitcherScript sources from:
- The Witcher 3 vanilla scripts
- REDkit project scripts
- mod scripts
- repository regression fixtures
The repository does not include proprietary game scripts. Keep local vanilla, REDkit, and mod corpora outside git and pass their directories to the runner.
uv run witcherscript corpus samples/fixtures/corpus_project/scriptsMultiple roots can be scanned in one run:
uv run witcherscript corpus \
"D:/Steam/steamapps/common/The Witcher 3/content/content0/scripts" \
"D:/REDkitProjects/MyMod/content/scripts" \
"D:/Games/The Witcher 3/Mods/modExample/content/scripts"Parser-only mode is available when semantic noise from incomplete external roots is not useful:
uv run witcherscript corpus --no-semantic path/to/scriptsThe command prints JSON with:
- scanned roots
- total
.wsfiles - parser coverage percentage
- clean analysis percentage
- files that produced diagnostics
- lexer/parser diagnostic count
- semantic diagnostic count
- diagnostic counts by code
- most common diagnostic code/message pairs
- per-file diagnostics for files that failed clean analysis
- elapsed analysis time
This makes it suitable for release checks and for comparing parser coverage before and after grammar changes.
Committed regression fixtures live in:
samples/fixtures/corpus_project/
They are original, compact scripts that mimic vanilla-like, REDkit-like, and mod-like code patterns without copying game content.
Do not commit proprietary scripts extracted from the game or REDkit installations.
Recommended local layout:
.corpus/
vanilla/
redkit/
mods/
The .corpus/ directory is ignored by git.