Suppression comment syntax
GLua recognizes several suppression styles in Lua comments. Suppressions take a diagnostic code — the kebab-case name shown in the Problems panel, such asunused-local. That is not the same as the camelCase
settings key (unusedLocal) you would use in .glua.json. See the
rule reference for both names.
Suppressions that do nothing
A suppression outlives the finding it was written for: the code gets fixed, the comment stays, and from then on it silently covers whatever appears on that line next.unused-suppression reports the
ones that never silenced anything.
A bare -- glua-ignore followed by prose still means “everything on the next
line”, so an explanation after the directive is fine:
When to use suppressions
Suppress the specific rule name when possible. Avoid
-- glua-ignore without a rule name because it silences every diagnostic on that line and can hide real problems.Not a suppression: -- glua-format-ignore
These comments silence diagnostics. The formatter has its own directive,
-- glua-format-ignore, which leaves
the statement below it exactly as written. They are unrelated: suppressing a
rule does not stop the formatter, and a format-ignore does not silence anything.