LLSCheck runs Lua Language Server diagnostics and formats the results for human readers.
It returns a non-zero exit code when diagnostics are found, making it easy to use in CI pipelines.
Lua Language Server must be installed locally
and lua-language-server must be in your $PATH.
Using LuaRocks:
luarocks install llscheckllscheck --helpUsage: llscheck [-h] [--completion {bash,zsh,fish}]
[--checklevel {Error,Warning,Information,Hint}]
[--configpath <configpath>] [<workspace>]
Generate a LuaLS diagnosis report and print to human-friendly format.
Arguments:
workspace The workspace to check. (default: .)
Options:
-h, --help Show this help message and exit.
--completion {bash,zsh,fish}
Output a shell completion script for the specified shell.
--checklevel {Error,Warning,Information,Hint}
The minimum level of diagnostic that should be logged. (default: Warning)
--configpath <configpath>
Path to a LuaLS config file. (default: .luarc.json)
--no-color Do not add color to output.
Note: LLSCheck operates on workspaces (directories), not individual files.
llscheck examples/demo/ # Correct llscheck examples/demo/init.lua # Wrong
See examples/neovim for using llscheck with Neovim projects
LLSCheck can be used as a Lua module:
local llscheck = require("llscheck")
local diagnosis = llscheck.check_workspace("src", "Warning", ".luarc.json")
local report, stats = llscheck.generate_report(diagnosis)
print(report)LLSCheck disables colored output when:
- llscheck is not run from a terminal (TTY).
- The NO_COLOR environment variable is present and not empty.
- The
--no-colorargument is provided.
LLSCheck runs as a Docker container. Build it with:
docker build -t llscheck https://github.com/jeffzi/llscheck.gitOptionally, you can pin the version of Lua Language Server with
--build-arg LLS_VERSION=3.7.0.
Once you have a container you can run it with arguments:
# Run llscheck on the src directory
docker run -v "$(pwd):/data" llscheck --checklevel Information srcOn an Apple Silicon chip M1+, you'll need to add the option --platform=linux/amd64 to both
docker commands.
Use pre-commit. Once installed,
add this to .pre-commit-config.yaml:
repos:
- repo: https://github.com/jeffzi/llscheck
rev: latest
hooks:
- id: llscheck
# args: ["--checklevel", "Hint"]