Skip to content

GDScript formatter 0.22.0

Choose a tag to compare

@github-actions github-actions released this 20 Jul 20:41
· 40 commits to main since this release

A fast code formatter for GDScript in Godot 4.

Changelog

Added

  • Added a profiling option to the benchmark script compatible with the samply profiler

Changed

  • Implemented new balanced line wrapping algorithm for long chains of expressions, including operations and boolean expressions
  • In chains of properties and method calls, the formatter will now try to preserve chains like a.b.c with long argument lists or nested lambdas. It will favor breaking the arguments in parentheses over breaking the chain into multiple lines
  • Specified the definition for continuation lines and changed function calls and other statements and expressions to use a single extra indent instead of two by default
  • Always force lambda functions to have a line return after the function declaration, like regular functions

Fixed

  • Conditions that exceed max-line-length by only a few columns get backslash + attribute-dot wrapping instead of the parenthesized and-wrap used for larger overflows (#270)
  • Fixed --reorder-code detaches trailing comments from top-level declarations and re-attaches them above the following declaration (#271)
  • Fix empty lines removed between conditional blocks (#276)
  • Fix editorconfig ignored when running from stdin (#275)
  • Fix code getting modified/comments getting mangled with operators in multiline chains of binary operator expressions (#278)
  • Fix Extra space is added after ! in if statements (#277)

Learn more about the formatter in the GDScript Formatter documentation