id = "luacheck"
name = "Luacheck"
homepage = "https://github.com/lunarmodules/luacheck"
description = "A tool for linting and static analysis of Lua code."
executables = ["luacheck"]
[dotfiles]
paths = [
"[appData]/Luacheck/.luacheckrc",
"%LOCALAPPDATA%/Luacheck/.luacheckrc",
"[configHome]/luacheck/.luacheckrc",
]
secret = []
[commands]
format = 1
label = "Lint Lua files"
description = "Check files or directories with luacheck. Covers the common filters and standards; formatter plugins, caching and parallel jobs are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = false, short_bundles = true }
[[commands.source]]
id = "docs"
kind = "manual"
url = "https://github.com/lunarmodules/luacheck/blob/master/docsrc/cli.rst"
revision = "master 2026-10-27"
evidence = """
``-g | --no-global`` Filter out warnings related to global variables.
``-u | --no-unused`` Filter out warnings related to unused variables and values.
``-r | --no-redefined`` Filter out warnings related to redefined variables.
``-a | --no-unused-args`` Filter out warnings related to unused arguments and loop variables.
``--no-self`` Filter out warnings related to implicit ``self`` argument.
``--std <std>`` Set standard globals, default is ``max``. ``<std>`` can be one of:
max, min, lua51, lua51c, lua52, lua52c, lua53, lua53c, lua54, lua54c, luajit, ngx_lua, love, busted, rockspec, luacheckrc, ldoc, sile, none
``--globals [<name>] ...`` Add custom global variables or fields on top of standard ones.
``--read-globals [<name>] ...`` Add read-only global variables or fields.
``--max-line-length <length>`` Set maximum allowed line length (default: 120).
``--no-max-line-length`` Do not limit line length.
``--ignore | -i <patt> [<patt>] ...`` Filter out warnings matching patterns.
``--only | -o <patt> [<patt>] ...`` Filter out warnings not matching patterns.
``--config <config>`` Path to custom configuration file (default: ``.luacheckrc``).
``--no-config`` Do not look up custom configuration file.
``--exclude-files <glob> [<glob>] ...`` Do not check files matching these globbing patterns.
``--no-cache`` Do not use cache.
``-q | --quiet`` Suppress report output for files without warnings.
``--codes`` Show warning codes.
``--no-color`` Do not colorize output.
"""
[[commands.field]]
id = "files"
label = "Files or directories"
type = "path"
path = { kind = "any", role = "input" }
position = 0
multiple = true
sources = ["docs"]
[[commands.field]]
id = "std"
label = "Standard globals"
type = "enum"
option = ["--std"]
choices = [
{ value = "max", label = "max (Lua 5.1-5.4 + LuaJIT)" },
{ value = "min", label = "min" },
{ value = "lua51", label = "Lua 5.1" },
{ value = "lua52", label = "Lua 5.2" },
{ value = "lua53", label = "Lua 5.3" },
{ value = "lua54", label = "Lua 5.4" },
{ value = "luajit", label = "LuaJIT" },
{ value = "ngx_lua", label = "OpenResty ngx_lua" },
{ value = "love", label = "LÖVE" },
{ value = "busted", label = "Busted" },
{ value = "none", label = "None" },
]
sources = ["docs"]
[[commands.field]]
id = "globals"
label = "Extra globals"
type = "string"
option = ["--globals"]
multiple = true
sources = ["docs"]
[[commands.field]]
id = "read_globals"
label = "Read-only globals"
type = "string"
option = ["--read-globals"]
multiple = true
sources = ["docs"]
[[commands.field]]
id = "no_unused"
label = "Hide unused-variable warnings"
type = "boolean"
option = ["--no-unused", "-u"]
sources = ["docs"]
[[commands.field]]
id = "no_unused_args"
label = "Hide unused-argument warnings"
type = "boolean"
option = ["--no-unused-args", "-a"]
sources = ["docs"]
[[commands.field]]
id = "no_global"
label = "Hide global-variable warnings"
type = "boolean"
option = ["--no-global", "-g"]
sources = ["docs"]
[[commands.field]]
id = "max_line_length"
label = "Max line length"
type = "integer"
option = ["--max-line-length"]
sources = ["docs"]
[[commands.field]]
id = "ignore"
label = "Ignore warnings matching"
description = "Warning codes or variable names."
type = "string"
option = ["--ignore", "-i"]
multiple = true
sources = ["docs"]
[[commands.field]]
id = "exclude_files"
label = "Exclude files (glob)"
type = "string"
option = ["--exclude-files"]
multiple = true
sources = ["docs"]
[[commands.field]]
id = "config"
label = "Config file"
type = "path"
path = { kind = "file", role = "input" }
option = ["--config"]
sources = ["docs"]
[[commands.field]]
id = "codes"
label = "Show warning codes"
type = "boolean"
option = ["--codes"]
sources = ["docs"]
[[commands.field]]
id = "quiet"
label = "Quiet (hide clean files)"
type = "boolean"
option = ["--quiet", "-q"]
sources = ["docs"]
[[commands.field]]
id = "no_color"
label = "No color"
type = "boolean"
option = ["--no-color"]
sources = ["docs"]
[[commands.task]]
id = "lint"
label = "Lint files"
fields = ["files", "codes", "quiet"]
required = ["files"]
[[commands.task]]
id = "lint_std"
label = "Lint against a standard"
fields = ["files", "std", "globals", "codes"]
required = ["files", "std"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["files", "std", "globals", "read_globals", "codes", "quiet"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["no_unused", "no_unused_args", "no_global", "max_line_length", "ignore", "exclude_files", "config", "no_color"]