.gluafmtrc.json is validated against
glua.bluejutzu.dev/schemas/gluafmtrc.schema.json,
the same schema glua init and GLua: Create Formatter Config File point
$schema at. This page documents every property it accepts. See the
Formatter page for what each option actually changes in
your code, and Config Files for a shorter
overview alongside .glua.json.
The schema sets
additionalProperties: false, so a typo’d key is flagged in your editor rather than silently ignored.Properties
string
URL of the JSON schema for this file. Written automatically by
glua init and the VS Code command.boolean
default:"true"
Indent with tabs instead of spaces.
integer, 1-16
default:"4"
Spaces per indent level — and, when
useTabs is on, the assumed display width of a tab for measuring line length.integer, 40-400
default:"120"
Column at which tables and argument lists wrap.
"preserve" | "double" | "single"
default:"preserve"
Preferred string quotes. A string is only rewritten when doing so needs no extra escaping.
"preserve" | "lua"
default:"preserve"
"lua" rewrites GLua’s C-style operators != && || ! as ~= and or not."preserve" | "lua"
default:"preserve"
"lua" rewrites // and /* */ comments as -- and --[[ ]].boolean
default:"false"
Write
func( a, b ) instead of func(a, b) — the style used across the Garry’s Mod wiki.boolean
default:"true"
Keep blocks written on one line on one line, e.g.
if not IsValid(ent) then return end. See idiomatic one-liners.integer, 0-10
default:"2"
Consecutive blank lines to keep between statements.
"remove" | "preserve"
default:"remove"
Whether to keep optional trailing semicolons.
"\n" | "\r\n"
Line ending to write. Defaults to whatever the file already uses.
overrides
An array of objects, applied in order — later entries win when two overrides
match the same file. Unlike .glua.json’s overrides, options is required
and only accepts formatting keys — no diagnostics or globals here.
string[]
required
Glob patterns relative to this file’s directory, e.g.
lua/vendor/**. At least one entry.object
required
A subset of the top-level properties above (excluding
$schema and overrides) to apply to matching files.Options not listed in an override keep whatever the top-level config (or the built-in default) says — an override only replaces the keys it names.