Skip to main content

run_lint

Function run_lint 

Source
pub fn run_lint(code: &str, chunk_name: &str) -> Result<LintResult, String>
Expand description

One-shot lint: creates a fresh Lua VM, collects stdlib symbols, and lints.

This is the simplest API — equivalent to mlua_lspec::run_tests.

let result = mlua_check::run_lint("print('hello')", "@test.lua").unwrap();
assert_eq!(result.diagnostics.len(), 0);