Crates.io | emmylua_check |
lib.rs | emmylua_check |
version | 0.14.0 |
created_at | 2025-02-04 03:57:18.837027+00 |
updated_at | 2025-09-19 11:30:42.020271+00 |
description | A command-line tool for checking lua code. |
homepage | |
repository | https://github.com/CppCXY/emmylua-analyzer-rust |
max_upload_size | |
id | 1541471 |
size | 101,827 |
emmylua_check
is a powerful command-line tool designed to help developers identify and fix potential issues in Lua code during development. It leverages the core analysis engine of emmylua-analyzer
to provide comprehensive code diagnostics, ensuring code quality and robustness.
.emmyrc.json
or .luarc.json
files, including enabling/disabling and severity levels.Install emmylua_check
via cargo:
cargo install emmylua_check
Analyze all Lua files in the current directory:
emmylua_check .
Analyze a specific workspace directory:
emmylua_check ./src
Use a specific .emmyrc.json
configuration file:
emmylua_check . -c ./config/.emmyrc.json
Ignore files in the vender
and test
directories:
emmylua_check . -i "vender/**,test/**"
Output diagnostics in JSON format to a file for further processing:
emmylua_check . -f json --output ./diag.json
emmylua_check
shares the same configuration system as the EmmyLua Language Server. You can create a .emmyrc.json
file in your project root to configure diagnostic rules.
Example .emmyrc.json
:
{
"diagnostics": {
"disable": [
"unused"
]
}
}
For detailed information on all available diagnostics and configuration options, see the EmmyLua Configuration Documentation.
You can easily integrate emmylua_check
into your GitHub Actions workflow to automate code checks.
Example .github/workflows/check.yml
:
name: EmmyLua Check
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install emmylua_check
run: cargo install emmylua_check
- name: Run check
run: emmylua_check .
Usage: emmylua_check [OPTIONS] [WORKSPACE]...
Arguments:
[WORKSPACE]... Path(s) to workspace directory
Options:
-c, --config <CONFIG> Path to configuration file. If not provided, ".emmyrc.json" and ".luarc.json" will be searched in the workspace directory
-i, --ignore <IGNORE> Comma-separated list of ignore patterns. Patterns must follow glob syntax
-f, --output-format <OUTPUT_FORMAT> Specify output format [default: text] [possible values: json, text]
--output <OUTPUT> Specify output target (stdout or file path, only used when output_format is json) [default: stdout]
--warnings-as-errors Treat warnings as errors
--verbose Verbose output
-h, --help Print help information
-V, --version Print version information