Checks Scheme scripts for problems without running them, with
Schooner.check/3.
$ mix schooner.check "scripts/**/*.scm" --env MyApp.Scripts.environment
scripts/discounts.scm:1:9: error[unknown_library]: library not found: (myapp promos)
scripts/draft.scm:1:27: error[unbound]: unbound variable: unit-prise
2 errors in 2 files
Each argument is a file, a directory (every .scm file under it) or a
glob. Quote globs so the task expands them rather than the shell.
The task fails when an argument matches no files.
Options
--env Mod.fun— check against theSchooner.Environmentreturned by the zero-arity functionMod.fun. Without it, the environment is the one configured withconfig :schooner, :tooling_environment, {Mod, :fun, args}and without that, every standard library, all imported: the surface
Schooner.run/1gives a script that imports nothing. Prefer your application's real environment, which is usually much narrower.--format text|json—text(the default) prints one line per diagnostic,file:line:col: severity[code]: message, and a summary.jsonprints one JSON object:{"diagnostics": [{"file": "scripts/draft.scm", "line": 1, "column": 27, "severity": "error", "code": "unbound", "message": "unbound variable: unit-prise"}], "errors": 1, "warnings": 0, "files": 2}filescounts the files checked.lineandcolumnarenullwhen the position is unknown. The task keeps compiler progress out of the JSON, but Mix may compile dependencies before the task starts, so runmix compilefirst when another program reads the output.--warnings-as-errors— fail when there are warnings, too.
The task exits with status 1 when it finds an error, and 0 otherwise.