asobi_lua_validate (asobi v0.72.5)

View Source

Validates a Lua file against the asobi_lua loader without starting the runtime — load it through asobi_lua_loader:new/1 so syntax errors, sandbox violations, and require/1 traversal attempts surface as a non-zero exit. Designed for CI use.

Usage

In a CI step running against the release image:

docker run --rm -v "$PWD/lua:/g" ghcr.io/widgrensit/asobi sh -c \
  'erts-*/bin/erl -noshell -boot no_dot_erlang -pa lib/*/ebin \
     -eval "asobi_lua_validate:cli([\"/g/match.lua\"])."'

A throwaway VM inside the image, not bin/asobi eval: cli/1 ends in halt/1, so running it on a live node would stop the server.

Exits 0 if the script loads clean, 1 with the loader's error reason on stderr otherwise. Multiple paths can be passed; they are validated sequentially and the script exits on the first failure.

Summary

Functions

cli/1

-spec cli([string() | binary()]) -> no_return().

validate(Path)

-spec validate(file:filename_all()) -> ok | {error, term()}.