---
name: luacheck
description: "Use when adopting Luacheck to assess this standard: Declare the globals Lua code may use"
---

# Apply Luacheck

Set the target Lua runtime and allowed globals. Flag accidental global writes, unused variables and unreachable code as part of the normal test workflow.

## Procedure

1. Inspect the repository configuration and identify the files or targets covered by Luacheck.
2. Use Luacheck in this repository to meet this standard: Declare the globals Lua code may use. Set the target Lua runtime and allowed globals. Flag accidental global writes, unused variables and unreachable code as part of the normal test workflow. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.
3. Record the tool version, configuration, scope and findings. Explain any checks that could not run.
4. Use the same invocation after changes and compare the evidence against the baseline.

Refer to [the upstream documentation](https://luacheck.readthedocs.io/) for configuration and prerequisites.

## Tool invocation

```
luacheck .
```
