Releases: JohnnyMorganz/StyLua
v0.15.3
[0.15.3] - 2022-12-07
Fixed
General
- Fixed necessary parentheses removed in
(-X) ^ Y
causing change in semantics (#623) - Take into account
function
token size when formatting an anonymous functionfunction() end
(particularly relevant when collapsing simple statements) (#619)
Luau
- Support hanging inside of Luau type arrays
{ T }
to fix formatting issues when comments are present (#617)
Full Changelog: v0.15.2...v0.15.3
v0.15.2
[0.15.2] - 2022-10-31
Fixed
- Fix incorrect indentation level used for hanging expressions in if expression syntax (#596)
- Fixed Luau return type in parentheses containing a comment on the last item being collapsed causing a syntax error (#608)
- Fix parentheses removed which highlight precedence in
(not X) == Y
causing linting errors (#609) - Fix build script for
@johnnymorganz/stylua
to include all lua and luau features (#614)
What's Changed
- Update readme (collapse_simple_statement) by @uga-rosa in #590
- Add default collapse_simple_statement to README.md by @kawarimidoll in #598
- Add
serialize
,fromstr
andwasm-bindgen
features by @RubixDev in #592 - Add hang level to hanging if expression by @JohnnyMorganz in #599
- Don't collapse when comment present in typeinfo tuple by @JohnnyMorganz in #612
- Don't remove excess parentheses which are highlighting precedence by @JohnnyMorganz in #610
- fix: 614 support all features in wasm by @ktrz in #615
New Contributors
- @uga-rosa made their first contribution in #590
- @RubixDev made their first contribution in #592
- @kawarimidoll made their first contribution in #598
- @ktrz made their first contribution in #615
Full Changelog: v0.15.1...v0.15.2
v0.15.1
v0.15.0
This release introduces support for Lua 5.3 and Lua 5.4!
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 #407)
Changes to GitHub Release Artifacts
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.
[0.15.0] - 2022-09-21
Added
- Added support for Lua 5.3, gated behind the
lua53
feature flag (#534) - Added support for Lua 5.4, gated behind the
lua54
feature flag (#533) - Added
--allow-hidden
flag to allow entering and formatting hidden files/directories (#562) - Added
--output-format=summary
which can be used with--check
to output a summary of the list of files not correctly formatted (#573)
Changed
Fixed
- Precommit hook now supports downloading aarch64 binary for M1 macs (#558)
- Fixed mistransformations of generic for loop with comments in the expression list (#579)
- Fixed
then
/else
token not taken into account when formatting an if-expression (#582) - Fixed macos-aarch64 artifact for real
What's Changed
- Enforce locked on cargo publish by @JohnnyMorganz in #557
- Update pyproject to support installing on M1 machines by @IamTheFij in #558
- feat: add
--allow-hidden
option by @wincent in #563 - Allow alternative way to compute large scale diffs by @JohnnyMorganz in #564
- Don't expand call with nested comment by @JohnnyMorganz in #549
- Update external test cases by @github-actions in #521
- Add search parent dirs config for VSCode extension by @filiptibell in #568
- Fix release build target by @JohnnyMorganz in #569
- Improve comments within function calls by @JohnnyMorganz in #566
- Rename release targets and add linux-aarch64 by @IamTheFij in #559
- Fix aarch64 linux builds by @IamTheFij in #572
- Add
--output-format=summary
by @JohnnyMorganz in #575 - Fix mistransformation of generic for comments by @JohnnyMorganz in #580
- Update external test cases by @github-actions in #578
- Consider multiline comment when inlining function call by @JohnnyMorganz in #581
- Take into account token width for if expression formatting by @JohnnyMorganz in #583
- Add Lua 5.3 and 5.4 support with full-moon update by @JohnnyMorganz in #576
New Contributors
- @wincent made their first contribution in #563
- @filiptibell made their first contribution in #568
Full Changelog: v0.14.3...v0.15.0
v0.14.3
[0.14.3] - 2022-08-27
Fixed
General
- Fixed macOS aarch64 target in release workflow (#528)
- Fixed leading comments lost from an expression when excessive parentheses are removed from it (#530)
- Fixed comments present in a complex expression not forcing multiline hanging leading to a syntax error (#524)
- Take into account the extra line created when hanging at equals token in an assignment. This should prevent unnecessary hanging (#542)
- Fixed comments added to a newly created trailing comment not being formatted (#547)
- Fixed call chain with a small prefix not being kept inlined causing unstable formatting (#514)
- Fixed shape computation for table fields causing unnecessary expansion (#551)
- Fixed hanging the prefix string in
("str"):call
unnecessarily when it provides no benefit (#508) - Fixed table field value being expanded when it could be hanged instead (#541)
Luau
- Long union/interesection types inside of a parentheses will now cause the parentheses to expand multiline (#531)
- Fixed unnecessary break on
else
in an if-expression when the expression contains a comment (#520)
What's Changed
- Expand regression test suite by @JohnnyMorganz in #523
- Fix aarch64 target by @mvllow in #529
- Add changelog links by @LastTalon in #532
- Format type parentheses multiline if long union/intersection by @JohnnyMorganz in #536
- Keep leading comments when removing excess parentheses by @JohnnyMorganz in #537
- Fix collapsing when comment present in complex expr by @JohnnyMorganz in #538
- Remove unnecessary else break in if expression comments by @JohnnyMorganz in #539
- Create
@johnnymorganz/stylua-bin
installable through npm by @JohnnyMorganz in #540 - Take into account extra line when hanging assignment by @JohnnyMorganz in #544
- Temporarily disable BlizzardInterfaceCode in LST by @JohnnyMorganz in #546
- Format comments added to new trailing comma by @JohnnyMorganz in #548
- Keep small prefix inlined in call chain by @JohnnyMorganz in #550
- Fix table field shape calculation by @JohnnyMorganz in #552
- Don't attempt to hang a prefix string unnecessarily by @JohnnyMorganz in #545
- Prefer hanging table field value over expanding by @JohnnyMorganz in #553
New Contributors
Full Changelog: v0.14.2...v0.14.3
v0.14.2
[0.14.2] - 2022-07-27
Fixed
- Fixed var expression with trailing comments on initial prefix being collapsed leading to malformed formatting (#509)
- Fixed return with comment between return and expression being collapsed leading to malformed formatting (#504)
- Fixed release assets for precommit by marking release artifacts as application/zip (#496)
What's Changed
- Set content type of release assets to zip by @JohnnyMorganz in #510
- Fix collapsing when varexpr prefix has trailing comments by @JohnnyMorganz in #511
- Fix collapsing when comment between return and expr by @JohnnyMorganz in #513
Full Changelog: v0.14.1...v0.14.2
v0.14.1
[0.14.1] - 2022-07-21
Changed
- Chained var expression formatting will now follow the exact same steps as chained function call formatting
Fixed
- Fixed var expression with comments collapsing leading to malformed formatting (#500)
- Fixed ignore behavior for
--stdin-filepath
(#495)
What's Changed
- Fix README typo by @Wyatt-Stanke in #498
- Fix clippy warnings by @JohnnyMorganz in #501
- Fix var expression collapsing when containing comments by @JohnnyMorganz in #502
- Fix ignore behavior for --stdin-filepath by @MunifTanjim in #495
New Contributors
- @Wyatt-Stanke made their first contribution in #498
- @MunifTanjim made their first contribution in #495
Full Changelog: v0.14.0...v0.14.1
v0.14.0
[0.14.0] - 2022-07-06
Added
--output-format=json
now outputs all (error) messages in JSON format (#453)- Added WASM build support. Stylua is available on npm for consumption in Node.js or a browser (using a bundler) - https://www.npmjs.com/package/@johnnymorganz/stylua
- Ignore comments will now be respected before fields inside tables (#448)
- Stylua library (
stylua_lib
) now exposes aformat_ast(ast, config, range, verification)
function to format a full-moon AST directly (#482) - Added
collapse_simple_statement
option. It can take the valuesNever
(default),FunctionOnly
,ConditionalOnly
orAlways
. 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.
Changed
- We now attempt to first hang the equals token in an assignment before expanding the RHS expression, provided the expression is not "complex" (#292, #489)
- We now use the current indent level of comments preceding an
elseif
/else
token to determine whether they should still be indented one level or inlined with theelseif
/else
token. (#254) - Static chained function calls (i.e.,
foo.bar().baz()
) will now hang if necessary (#368) - The first call in a chained function call will now inline with the prefix if the prefix begins with an uppercase letter or the prefix is smaller (in length) than the indent width
- A chained function call will not expand if the first call gets inlined and there is only 2 calls
Fixed
- [Luau] Fixed spacing lost before a comment within a type generic (#446)
- [Luau] Removed unnecessary expansion of a type generic with a single table as the parameter (#442)
- Fixed incorrect extra indentation of an expanded parentheses passed as a function call argument (#456)
- [Luau] Increased the shape size of the expression in a type assertion so that it will correctly hang if over width (#466)
- Fixed binary expression in a table field containing a comment being collapsed leading to malformed formatted (#471)
- Fixed end parentheses of a function call with a multiline comment internally being expanded onto a new line unnecessarily (#473)
- Fixed severe performance regression with complex nested function calls (#477)
What's Changed
- Build release on Ubuntu 18 by @stopdropandrew in #445
- Type generics comment spacing by @JohnnyMorganz in #449
- Hug single table in type generic by @JohnnyMorganz in #450
- Fix some typos by @mhmdanas in #451
- Remove extraneous whitespace by @mhmdanas in #452
- Create JSON-compatible errors by @JohnnyMorganz in #455
- Fix extra indent of expanded parens inside function call by @JohnnyMorganz in #457
- Simplify trivia updater macros by @JohnnyMorganz in #458
- Force shape increment LHS value in type assertion by @JohnnyMorganz in #467
- Add wasm build support by @JohnnyMorganz in #468
- Allow ignore comments before table fields by @JohnnyMorganz in #469
- Fix syntax error field binexp w/ comment collapsed by @JohnnyMorganz in #472
- Fix call parens unnecessarily expanded new line by @JohnnyMorganz in #474
- Add
stylua.disableVersionCheck
by @JohnnyMorganz in #475 - Fix severe perf regression of complex nested function calls by @JohnnyMorganz in #478
- Hang assignment at equal token before expanding RHS by @JohnnyMorganz in #342
- Fix comment indentation on elseif/else token by @JohnnyMorganz in #480
- Workflow testing by @JohnnyMorganz in #481
- Expose
format_ast
functionality by @JohnnyMorganz in #483 - Hang static chained function calls by @JohnnyMorganz in #470
- Use initial comment indentation level for elseif/else comments by @JohnnyMorganz in #488
- Simplify "simple heuristics" even further by @JohnnyMorganz in #492
- Prevent hanging on equals token for complex expression by @JohnnyMorganz in #491
- Collapse simple statements onto single line, behind option by @JohnnyMorganz in #479
New Contributors
Full Changelog: v0.13.1...v0.14.0
v0.13.1
[0.13.1] - 2022-04-11
Fixed
General
- Fixed leading trivia on semicolon lost when semicolon is removed (#431)
- Fixed shape calculation of the RHS of a binary expression not correctly reset when hanging, causing it to expand unnecessarily (#432)
- Fixed unstable formatting of tables at column width boundary (#436)
- Fixed assignments no longer hanging at equals token if a comment is present, but the expression is not hangable at a binop. (#439)
Luau
- Fixed unstable formatting around comments within type declarations (#397, #430)
- Fixed parentheses around type assertions in a binary expression being removed leading to incorrect semantics. (#441)
What's Changed
- Fix semicolon leading comments lost when semicolon removed by @JohnnyMorganz in #433
- Reset RHS expression shape when hanging at binop by @JohnnyMorganz in #434
- Fix unstable formatting of tables at column width boundary by @JohnnyMorganz in #437
- Hang at equals token in assignment if expression cannot hang internally by @JohnnyMorganz in #440
- Fix unstable formatting around comments in type declarations by @JohnnyMorganz in #435
- Keep parens around type assertion if in binexp by @JohnnyMorganz in #443
Full Changelog: v0.13.0...v0.13.1
v0.13.0
NOTE: This release removes the version from the release file names (#343). If you have automated tooling to download StyLua releases, you may need to update them to exclude the version from the name
[0.13.0] - 2022-03-31
Added
General
- Added support for alternative diff outputs. You can now use
--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 aspatch
ordelta
, whilst a JSON diff provides a more machine readable format useful for extensions. (#230)
Changed
General
- Migrate internal dependency for CLI arguments handling, with improved help messages.
- Generic fors will no longer expand onto multiple lines if the expression looping over is a function call with a single table argument (e.g.,
ipairs({ ... })
) (#405) - When hanging an assignment of an expression contained within parentheses, we do not add an extra indentation. The formatting is now consistent with expanded tables and function calls. (#274)
Luau
- Type declarations consisting of unions/intersections where an inner type has a multiline comment will now force hanging
- Excess parentheses around a type assertion will now be removed. (#383, #425)
Fixed
General
- Fixed issue through static linking where Windows binary would not execute due to missing
VCRUNTIME140.dll
. (#413) - Fixed assignment with comment sometimes not hanging leading to malformed syntax. (#416)
- Fixed block ignores not applied when multiple leading block ignore comments are present at once. (#421)
- Fixed ordering of comments when semicolon after statement is removed. (#423)
What's Changed
- Break down function argument code by @JohnnyMorganz in #408
- Migrate to clap v3 with new help messages by @JohnnyMorganz in #409
- Add support for alternative diff outputs by @JohnnyMorganz in #411
- Hang type union declarations if multiline comment is seen by @JohnnyMorganz in #402
- Hug generic for when expression is function call with single table arg by @JohnnyMorganz in #412
- Revert 1.58 format string syntax by @JohnnyMorganz in #417
- Statically link the vc runtime by @JohnnyMorganz in #418
- Remove excess parentheses around type assertions by @JohnnyMorganz in #419
- Always hang assignment if it contains comments by @JohnnyMorganz in #420
- Fix block ignore not applied when multiple comments present by @JohnnyMorganz in #422
- Fix comments ordering when semicolon removed after stmt by @JohnnyMorganz in #424
- Fix parentheses incorrectly removed around assertion when hanging by @JohnnyMorganz in #426
- Perform large scale testing by @JohnnyMorganz in #428
- Fix large scale test action by @JohnnyMorganz in #429
- Don't hang an extra level when hanging parens assignment by @JohnnyMorganz in #427
Full Changelog: v0.12.5...v0.13.0