> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Luacheck

> CodeRabbit's guide to Luacheck.

[Luacheck](https://github.com/mpeterv/luacheck) is a static analyzer and linter for Lua code that detects various issues such as undefined global variables, unused variables and values, accessing uninitialized variables, unreachable code, and more.

## Supported Files

Luacheck will run on files with the following extensions:

* `.lua`

## Configuration

Luacheck supports the following configuration files:

* `.luacheckrc`
* `luacheckrc`
* `.luacheckrc.lua`
* `luacheckrc.lua`

<Note>
  Luacheck does not require configuration to run. If no configuration file is found, it will use default settings.
</Note>

## When we skip LuaCheck

CodeRabbit will skip running LuaCheck when:

* LuaCheck is already running in GitHub workflows.

## Ignored rules

The following LuaCheck rules are automatically ignored:

* `W113` - accessing undefined variable
* `W611` - line too long
* `W112` - line contains only whitespace
* `W631` - line that ends with whitespace

## Profile behavior

In **Chill** mode, LuaCheck only reports errors (not warnings).

In **Assertive** mode, LuaCheck reports both errors and warnings.

## Features

Luacheck can detect:

* Usage of undefined global variables
* Unused variables and values
* Accessing uninitialized variables
* Unreachable code
* And many more issues

## Links

* [Luacheck GitHub Repository](https://github.com/mpeterv/luacheck)
* [Luacheck Documentation](https://luacheck.readthedocs.io/)
