S lint

From Falkicon/Mechanic · View interactive version

S lint is an AI agent skill from the GitHub repository Falkicon/Mechanic. Lint and format WoW addon Lua with Luacheck and StyLua through addon.lint and addon.format. Covers common warning codes, the repository .luacheckrc, StyLua defaults and how lint relates to the static analyzers. Triggers: lint, format, style, luacheck, stylua, warnings, code style.

How to use this skill

Skill file

Linting WoW Addons

Guidance for code quality and formatting. Call the MCP tools directly (using-mechanic).

Related Commands

MCP Tools

| Task | MCP Tool |

|------|----------|

| Lint | addon.lint(addon="MyAddon") (read-only) |

| Check formatting only | addon.format(addon="MyAddon", check=true) (read-only in effect) |

| Format (rewrites files) | addon.format(addon="MyAddon") |

addon.lint and addon.format run in the addon folder, so the addon's .luacheckrc / stylua.toml apply. If the tools are missing, tools.status reports it (mech setup installs them for the user). Security, complexity and dead-code analysis live in the analyzers: s-audit, s-clean.

Workflow

  1. addon.format(check=true) to see what would change; then addon.format if the diff is only style.
  2. addon.lint; fix real problems (undefined globals are usually typos or missing read_globals).
  3. Re-run addon.lint to confirm. Do not reformat whole files you are not otherwise changing.

Common Luacheck warnings

| Code | Meaning | Fix |

|------|---------|-----|

| W111 | Setting undefined global | Fix the typo or declare it in globals |

| W112 | Mutating undefined global | Same as W111 |

| W113 | Accessing undefined global | Check the API exists; add to read_globals |

| W211 | Unused local variable | Remove it or prefix with _ |

| W212 | Unused argument | Prefix with _ (for example _event) |

| W213 | Unused loop variable | Prefix with _ |

| W311 | Value assigned but never used | Remove the assignment or use the value |

| W431 | Shadowing upvalue | Rename the local |

Configuration in this repository

Best practices

  1. Lint before commit.
  2. Keep read_globals honest: add only APIs you actually call, and prefer modern C_ APIs (api-patterns).
  3. Prefix intentionally unused variables with _.
  4. Treat lint as necessary, not sufficient: it proves nothing about in-game behaviour.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.