StyLua
StyLua copied to clipboard
An opinionated Lua code formatter
File content(at the bottom should be attached raw, not formatted file - github removes some non-printable characters, so copying from here may not work): ``` max = max or 0xffffffff...
I get this error: ``` [ERROR] Formatter 'stylua' error: error: could not format from stdin: failed to format from stdin: INTERNAL ERROR: Output AST generated a syntax error. Please report...
A program such as this will not format as it seems integer division isn't supported by the parser. ```lua local value = 3 value //= 2 ``` The error for...
If you have `collapse_simple_statement` for conditionals and you add a function as the statement ```luau if bar then return function() foo() end end ``` it will collapse the function as...
When you call a function with a typecasting inside like this: ```luau Foo({} :: SomeType) ``` The parentheses and the typecast gets removed, so the code formats like this: ```luau...
A column width-exceeding function definition with multiple return types with generics collapses over one of the type parameters instead of placing each return type on a new line. Before and...
test result on LoongArchLinux: ``` running 57 tests test editorconfig::tests::test_call_parentheses_no_single_table ... ok test editorconfig::tests::test_call_parentheses_always ... ok test editorconfig::tests::test_call_parentheses_no_single_string ... ok test editorconfig::tests::test_call_parentheses_none ... ok test editorconfig::tests::test_collapse_simple_statement_always ... ok test editorconfig::tests::test_collapse_simple_statement_conditional_only...
Union type `Status` with comments, inside table type `Foo` ```luau type Foo = { Status: "loading" -- loading | "error" -- error | "success" -- success } ``` reformats to...
I recently did a PR on [oxsecurity/megalinter](https://github.com/oxsecurity/megalinter) where I tried to include `stylua` in the linters for `LUA`. When using the `Docker` approach I ran into some issues, that using...