# 使用 Homebrew, apk, pacman, apt, scoop, zypper 安装 luacheck

查看 luacheck 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:luacheck
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install luacheck
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add luacheck
```

  证据: Alpine Linux edge package indexes: luacheck from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- pacman (92%):

```sh
sudo pacman -S luacheck
```

  证据: Arch Linux sync databases: luacheck from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- Debian apt (92%):

```sh
sudo apt install lua-check
```

  证据: Debian stable package indexes: lua-check from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- zypper (92%):

```sh
sudo zypper install lua53-luacheck
```

  证据: openSUSE Tumbleweed package metadata: lua53-luacheck from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/luacheck
```

  证据: Scoop official bucket manifest trees: bucket/luacheck.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:luacheck
- **软件包管理器:** Homebrew
- **版本:** 1.2.0
- **来源摘要:** Tool for linting and static analysis of Lua code
- **主页:** <https://luacheck.readthedocs.io/>
- **仓库:** <https://github.com/lunarmodules/luacheck>
- **最后更新:** 2026-06-29T22:26:50Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- luacheck (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.2.0
## 项目历史与用法

Luacheck is a command-line static analyzer and linter for Lua. It reports issues such as undefined globals, unused variables, uninitialized variables, unreachable code, and syntax errors, while allowing project-specific global sets and per-file configuration.

### 项目历史

Luacheck began as a Lua linter by Peter Melnichenko, with the changelog recording 0.1.0 as the first release on 25 Mar 2014. Early releases quickly added command-line reporting, stdin and directory checking, config loading, Lua 5.2/5.3/LuaJIT syntax support, and the warning-code system that made the tool useful in editors and CI.

The project matured through the 0.x line by adding inline comments, caching, parallel checking, custom formatters, rockspec handling, and support for newer Lua versions. The README describes Luacheck as written in Lua, runnable on Lua 5.1 through 5.4 and LuaJIT, and configurable from CLI options, config files, or inline Lua comments.

In 2022 the project moved through the 1.0 milestone and adopted semver-oriented release expectations. Later changelog entries show package-maintenance work around Docker images, GitHub Actions, new builtin standard sets, NO_COLOR support, and Lua ecosystem integrations such as SILE, Ldoc, Playdate, and Minetest globals.

### 采用历史

Luacheck was adopted because Lua's global-variable model makes typos and accidental globals easy to miss. Its support for named standard-global sets, project globals, inline suppressions, editor-oriented stable output, and recursive directory checking made it practical for projects that wanted CI linting without imposing a full type system.

The official README lists editor integrations for Vim/Syntastic, SublimeLinter, Atom, Emacs/Flycheck, Brackets, VS Code, Nova, Geany, Node.js bindings, Gulp, Docker, and GitHub Actions. The supplied package-manager facts show distribution packages for apk, Homebrew, Debian/Ubuntu, pacman, Scoop, and zypper.

### 使用方式

Users run luacheck with files, directories, stdin, or rockspecs. The CLI returns distinct exit codes for clean runs, warnings, syntax or inline-option errors, file errors, and critical argument/config/cache errors, which makes it straightforward to wire into CI.

Configuration is usually a .luacheckrc file discovered from the current directory upward, a platform-specific default config path, or a custom --config path. Config files are Lua scripts that set options such as std, globals, read_globals, ignore, enable, line length, and per-path overrides.

### 为什么软件包爱好者会关心

Luacheck is the old reliable Lua linter package: small, scriptable, available as a CLI, and easy to connect to editors and CI. Package nerds care about it because it sits at the intersection of Lua versions, LuaRocks modules, editor plugins, and distribution packages, and because its config lookup behavior directly affects how projects lint in reproducible builds.

### 时间线

- 2014-03-25: Luacheck 0.1.0 was the first release.
- 2014: Early releases added directory checking, config loading, Lua 5.2/5.3/LuaJIT syntax support, and warning codes.
- 2015: Luacheck added inline options, custom output formatters, caching, parallel checking, and version reporting.
- 2020: Luacheck added Lua 5.4 standard definitions and parser/runtime compatibility work.
- 2022: Luacheck v1.0.0 marked the semver-era milestone.
- 2024: Luacheck 1.2.0 added Minetest standard support and performance fixes.

### Related projects

- Lua is the language Luacheck analyzes.
- LuaRocks is the installation path documented by the official README.
- LuaFileSystem is used for recursive directory checking when installed through LuaRocks.
- Busted, rockspec, OpenResty ngx_lua, and other named standard sets appear in Luacheck's supported globals.
- LuaLS overlaps as a language-server tool, while Luacheck remains focused on linting and static analysis.

### 来源

- <https://luacheck.readthedocs.io/en/stable/>
- <https://luacheck.readthedocs.io/en/stable/cli.html>
- <https://luacheck.readthedocs.io/en/stable/config.html>
- <https://raw.githubusercontent.com/lunarmodules/luacheck/master/CHANGELOG.md>
- <https://raw.githubusercontent.com/lunarmodules/luacheck/master/README.md>
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- macOS: ~/Library/Application Support/Luacheck/.luacheckrc
- Unix: .luacheckrc, $XDG_CONFIG_HOME/luacheck/.luacheckrc, ~/.config/luacheck/.luacheckrc
- Windows: %LOCALAPPDATA%\Luacheck\.luacheckrc
## 其他软件包管理器记录

- Debian apt - lua-check - 1.2.0-1: normalized package name match | Debian stable package indexes: lua-check from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | static analyzer and a linter for the Lua language | https://github.com/luarocks/luacheck
- Ubuntu apt - lua-check - 1.1.2-1: normalized package name match | Ubuntu 24.04 LTS package indexes: lua-check from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | static analyzer and a linter for the Lua language | https://github.com/luarocks/luacheck
- apk - luacheck - 1.2.0-r1: normalized package name match | Alpine Linux edge package indexes: luacheck from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | A tool for linting and static analysis of Lua code | https://github.com/lunarmodules/luacheck
- pacman - luacheck - 1.2.0-4: normalized package name match | Arch Linux sync databases: luacheck from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A tool for linting and static analysis of Lua code | https://github.com/lunarmodules/luacheck
- zypper - lua53-luacheck - 1.2.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: lua53-luacheck from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Command-line tool for linting and static analysis of Lua code | https://github.com/lunarmodules/luacheck
- zypper - lua54-luacheck - 1.2.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: lua54-luacheck from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Command-line tool for linting and static analysis of Lua code | https://github.com/lunarmodules/luacheck
- zypper - lua55-luacheck - 1.2.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: lua55-luacheck from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Command-line tool for linting and static analysis of Lua code | https://github.com/lunarmodules/luacheck
- zypper - luajit-luacheck - 1.2.0-1.1: normalized package name match | openSUSE Tumbleweed package metadata: luajit-luacheck from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Command-line tool for linting and static analysis of Lua code | https://github.com/lunarmodules/luacheck
- Scoop - main/luacheck: normalized package name match | Scoop official bucket manifest trees: bucket/luacheck.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/luacheck.yml](https://github.com/mxcl/pkgdb/blob/main/combined/luacheck.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
