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

# Tooling

> Static linting and formatting — the only verification layer for this repo.

There is **no build, test runner, or Lua interpreter** in this repo. Runtime behavior is validated only by loading the addon in-game through WGG. Static linting and formatting are the verification layer:

| Tool                                              | Scope              | Command                         | Config                           |
| ------------------------------------------------- | ------------------ | ------------------------------- | -------------------------------- |
| [selene](https://kampfkarren.github.io/selene/)   | Lua lint           | `selene .`                      | `selene.toml` (excludes `Libs/`) |
| [StyLua](https://github.com/JohnnyMorganz/StyLua) | Lua format         | `stylua .`                      | `stylua.toml` + `.styluaignore`  |
| [Biome](https://biomejs.dev/)                     | JSON lint/format   | `biome check .`                 | `biome.json` (JSON only)         |
| [Lua Language Server](https://luals.github.io/)   | Editor diagnostics | `lua-language-server --check .` | `.luarc.json`                    |

Root `.worktrees/` scratch repository copies are excluded from both Selene and Biome scans, so root verification does not lint duplicate repositories.

## Install

```sh theme={null}
brew install selene stylua lua-language-server
# or: cargo install selene stylua
# Biome: npx @biomejs/biome
```

## Verify after every change

Run the checks relevant to the files you touched **before claiming work is done**:

```sh theme={null}
selene . && stylua --check . && biome check .
```

* All invoked checks must pass (exit 0). Fix and re-run on failure.
* Use `stylua --check` (not `stylua .`) so verification never silently rewrites files.

`scripts/verify.sh` runs the required static checks, and `scripts/core-concat.sh` verifies Gatherer core re-slices (strip each file's header, concatenate bodies in load order, and diff against the previous combined source).

## Editor diagnostics

`.luarc.json` configures the VS Code Lua extension (`sumneko.lua`) for a warning-free Problems panel:

* Pins `runtime.version` to **Lua 5.1** and ignores `Libs/` and tooling directories.
* **Declares the WoW + WGG runtime API and the bot's shared globals** in `diagnostics.globals` — this resolves \~1800 false positives while keeping `undefined-global`, `lowercase-global`, and `deprecated` enabled, so genuine typos are still caught.
* Only the type-inference diagnostic family (which needs full WoW/WGG *type signatures*, not just names) and the global-sharing `unused-*` hints stay disabled.
* `types/wow.lua` is an editor-only `---@meta` stub (not in `loadorder.json`) defining the `Frame`/`Button` widget types used by `---@return` annotations.

<Note>
  When you call a new WoW/WGG global or add an intentional shared global, add its name to `diagnostics.globals` in `.luarc.json`. This includes Gatherer helpers that are read across files because the core loads top-to-bottom. Verify with `lua-language-server --check .` — it should report "no problems found".
</Note>
