Bot releases are visible (Hide)
stylua-linux-x86_64-musl
(#834).gitignore
or global git configuration), as well as in an .ignore
file (used by ripgrep and The Silver Searcher).styluaignore
files). (#833).styluaignore
not matching when using --respect-ignores
(#845)//
) syntax when only Luau command line flag is enabled{{
is invalid syntax)Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.19.1...v0.20.0
Published by github-actions[bot] 11 months ago
--respect-ignores
. By default, files explicitly passed to stylua (e.g. stylua foo.lua
) will always be formatted, regardless of whether the file is ignored. Enabling this flag will consider .styluaignore
or glob matches before formatting the file. (#765)
Updated parser crate with following changes:
//
)\z
escape parsingSimplified access and modification patterns for StyLua configuration. You can now access the properties directly
.property()
and .with_property()
are now deprecated.property
/ .property()
implementation, the .property()
functions were removed from WASM output.Multiline comments before commas will now remain in place and not move to after the comma. This is to support type-assertions-via-comments that is commonly used by some language servers. (#778)
Published by github-actions[bot] about 1 year ago
LL
/ULL
causing a panic when running in --verify
mode (#750)collapse_simple_statement
is enabled and the block begins with an empty line (#744)Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.18.1...v0.18.2
Published by github-actions[bot] over 1 year ago
-- stylua: ignore start
/ -- stylua: ignore end
) will now work within table fields:require("foo").bar {
-- stylua: ignore start
baz =0, -- < not formatted
foo = 2, -- < not formatted
-- stylua: ignore end
bar = 1234 -- < formatted
}
"Input"
to call_parentheses
setting, where call parentheses are retained based on their presence in the original input code.{
of a multiline table forces one of the lines over width--sort-requires
to enable sort requires on the command line$ stylua --sort-requires test.lua
(B?)
causing syntax errors when present in an intersection A & (B?)
Published by github-actions[bot] over 1 year ago
Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.17.0...v0.17.1
Published by github-actions[bot] over 1 year ago
local NAME = require(EXPR)
lexicographically on NAME
.local NAME = game:GetService(EXPR)
will also be sorted separately.This feature is disabled by default. To enable it, add the following to your stylua.toml
:
[sort_requires]
enabled = true
Note: we assume that all requires are pure with no side effects. It is not recommended to use this feature if the ordering of your requires matter.
stylua.toml
was found.This feature is enabled by default, it can be disabled using --no-editorconfig
.
editorconfig
feature by @LEI in https://github.com/JohnnyMorganz/StyLua/pull/645
Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.16.1...v0.17.0
Published by github-actions[bot] over 1 year ago
Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.16.0...v0.16.1
Published by github-actions[bot] almost 2 years ago
goto
statement when collapse_simple_statement
is set (#618)local name = function
will no longer hang at the equals token, and instead force parameters multiline, to reduce unnecessary indentation. (#595)local x = function()
being unnecessarily indented if the function body contains a comment (#627)return
token and the expressions (#605)Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.15.3...v0.16.0
Published by github-actions[bot] almost 2 years ago
(-X) ^ Y
causing change in semantics (#623)function
token size when formatting an anonymous function function() end
(particularly relevant when collapsing simple statements) (#619){ T }
to fix formatting issues when comments are present (#617)Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.15.2...v0.15.3
Published by github-actions[bot] almost 2 years ago
(not X) == Y
causing linting errors (#609)@johnnymorganz/stylua
to include all lua and luau features (#614)serialize
, fromstr
and wasm-bindgen
features by @RubixDev in https://github.com/JohnnyMorganz/StyLua/pull/592
Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.15.1...v0.15.2
Published by github-actions[bot] about 2 years ago
When compiling/installing with cargo, pass --features lua53
or --features lua54
respectively. By default, the GitHub Releases build with Lua 5.3 and 5.4 enabled (but note issues such as https://github.com/JohnnyMorganz/StyLua/issues/407)
This release changes the naming for binary artifacts. We now append the arch to the end of all artifacts
stylua-win64.zip
-> stylua-windows-x86_64.zip
stylua-macos.zip
-> stylua-macos-x86_64.zip
stylua-linux.zip
-> stylua-linux-x86_64.zip
Linux aarch64 is also now supported, alongside macOS aarch64.
The old artifact naming is kept temporarily for backwards compatibility. We recommend any references to be changed, as these artifacts will no longer be produced in future versions.
lua53
feature flag (#534)lua54
feature flag (#533)--allow-hidden
flag to allow entering and formatting hidden files/directories (#562)--output-format=summary
which can be used with --check
to output a summary of the list of files not correctly formatted (#573)then
/else
token not taken into account when formatting an if-expression (#582)--allow-hidden
option by @wincent in https://github.com/JohnnyMorganz/StyLua/pull/563
--output-format=summary
by @JohnnyMorganz in https://github.com/JohnnyMorganz/StyLua/pull/575
Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.14.3...v0.15.0
Published by github-actions[bot] about 2 years ago
("str"):call
unnecessarily when it provides no benefit (#508)else
in an if-expression when the expression contains a comment (#520)@johnnymorganz/stylua-bin
installable through npm by @JohnnyMorganz in https://github.com/JohnnyMorganz/StyLua/pull/540
Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.14.2...v0.14.3
Published by github-actions[bot] about 2 years ago
Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.14.1...v0.14.2
Published by github-actions[bot] about 2 years ago
--stdin-filepath
(#495)Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.14.0...v0.14.1
Published by github-actions[bot] over 2 years ago
--output-format=json
now outputs all (error) messages in JSON format (#453)stylua_lib
) now exposes a format_ast(ast, config, range, verification)
function to format a full-moon AST directly (#482)collapse_simple_statement
option. It can take the values Never
(default), FunctionOnly
, ConditionalOnly
or Always
. When enabled, "simple" functions or if statements (ones where they only return a value or have a simple statement such as a function call) will be collapsed onto a single line where possible.elseif
/else
token to determine whether they should still be indented one level or inlined with the elseif
/else
token. (#254)foo.bar().baz()
) will now hang if necessary (#368)stylua.disableVersionCheck
by @JohnnyMorganz in https://github.com/JohnnyMorganz/StyLua/pull/475
format_ast
functionality by @JohnnyMorganz in https://github.com/JohnnyMorganz/StyLua/pull/483
Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.13.1...v0.14.0
Published by github-actions[bot] over 2 years ago
Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.13.0...v0.13.1
Published by github-actions[bot] over 2 years ago
NOTE: This release removes the version from the release file names (https://github.com/JohnnyMorganz/StyLua/issues/343). If you have automated tooling to download StyLua releases, you may need to update them to exclude the version from the name
--output-format=unified
or --output-format=json
to output a unified diff or json mismatches list respectively. A unified diff can be fed into other tools such as patch
or delta
, whilst a JSON diff provides a more machine readable format useful for extensions. (#230)ipairs({ ... })
) (#405)VCRUNTIME140.dll
. (#413)Full Changelog: https://github.com/JohnnyMorganz/StyLua/compare/v0.12.5...v0.13.0