github JohnnyMorganz/StyLua v0.10.0

latest releases: v0.20.0, v0.19.1, v0.19.0...
2 years ago

[0.10.0] - 2021-07-11

Added

  • Added flag --verify which, when enabled, attempts to verify the generated output AST with the input AST to detect any changes to code correctness. Useful for adopting StyLua into a large codebase, at the cost of slower processing. (#199)
  • Added optional command line options --column-width, --indent-type, --indent-width, --line-endings and --quote-style, which, when provided, will override any configuration setting inferred from the default or a stylua.toml. (#213)
  • Added multithreaded support for formatting file in the CLI. Now each file will be formatted in its own thread. The number of threads used defaults to the number of cores on your computer, but can be set using --num-threads
  • Added support for disabling formatting over specific ranges. Use -- stylua: ignore start to disable formatting and -- stylua: ignore end to re-enable it. The comment must be preceding a statement and disabling formatting cannot cross block scope boundaries. (#198)

Changed

  • Luau type tables (luau feature flag) now use the same formatting strategy as normal expression tables, so that their formatting is more aligned.
  • Luau typings now have improved checking against the current shape width to determine how to format if over column width.
  • Luau callback types will now format multiline if they become over width under the luau feature flag.
  • Improved the formatting of return expressions, they are now more in line with assignment expressions. (#194)
  • Changed buffering of error messages in the CLI. Originally, they would be buffered till the end, but now they are output immediately when seen.
  • Allowed the use of --check when taking input from stdin.
  • An error when parsing provided globs will cause the program to immediately exit rather than continuing with the incorrect glob.
  • Only diff errors will exit with a status code of 1. Other errors (e.g. parse errors or internal errors) will now exit with status code of 2.

Fixed

  • Fixed comments inside Luau type tables leading to malformed formatting under the luau feature flag. (#219)
  • Fixed multiple assignment where an expression was originally hung due to comments being collapsed leading to malformed formatting. (#222)
  • Fixed an issue where a function call with a single table argument being hugged with the parentheses which contain comments leading to a syntax error. (#224)

Don't miss a new StyLua release

NewReleases is sending notifications on new releases.