Releases: GDQuest/GDScript-formatter
Release list
GDScript formatter 0.24.0
A fast code formatter for GDScript in Godot 4.
Changelog
Added
- You can now exclude files and folders using the
--exclude/-xflag orgdscript_formatter_excludein your editorconfig files (#299)
Fixed
- Fixed edge case when a lambda is at the end of an argument list and ends with a match statement, causing the formatter to insert a trailing comma (#301)
- Fixed a case of a long function definition that would not wrap on multiple lines despite being a little over 100 characters (#300)
- Fixed a multiline argument in a function call that's not at the end of a chain of function calls forcing explicit line continuations for the rest of the chain (#298)
Learn more about the formatter in the GDScript Formatter documentation
GDScript formatter 0.23.0
A fast code formatter for GDScript in Godot 4.
Changelog
Added
- Handle Tree-sitter parse errors gracefully, preserve declarations with parse errors while formatting valid code around them (#279)
Changed
- Force short lines that were manually wrapped on multiple lines with commas to merge back into one line when they fit within the max line length (this behavior was a leftover from the old formatter implementation)
- Changed editor settings for safe and reorder mode; they're now a single format mode
- Deprecated
--safeflag, renamed into--verify-structure
Fixed
- Fix type casts with type subscripts wrapping when placed at the end of long lines (e.g.
[long, array] as Array[SomeType]) - Fix icon annotation being reordered below class_name when extends was before class_name (#295)
- Godot addon: Fix error when running the formatter with both safe and reorder mode active; they're now mutually exclusive in the editor settings (#286)
Learn more about the formatter in the GDScript Formatter documentation
GDScript formatter 0.22.2
A fast code formatter for GDScript in Godot 4.
Changelog
Fixed
- Fix long ternaries without pre-existing backslashes or delimiters formatting in a way that GDScript doesn't parse (the formatter will now add parentheses around the expression and indent it) (#293)
- Fix non-parenthesized lambda can lead to a parse error when not parenthesized or followed by other arguments (#292)
- Fix max_line_length in .editorconfig ignored when linting (#272)
Learn more about the formatter in the GDScript Formatter documentation
GDScript formatter 0.22.1
A fast code formatter for GDScript in Godot 4.
Changelog
Fixed
- Make sure to keep tool at the top of the script, above class_name and extends (#285)
- Fixed generic type parameters breaking across lines (#283)
- Fixed is not being lost in a parenthesized expression (#284)
- Fixed conditional expression keyword detection to avoid breaking after
if/elsekeywords (#291) - Fixed lambda functions inside parentheses inside an argument list resulting into invalid syntax (#287)
- Fixed formatting not idempotent for this pattern:
await (call(lambda).chain(...))(#281) - Godot addon: Fixed performance issues when typing on Steam version of Godot (#262)
Learn more about the formatter in the GDScript Formatter documentation
GDScript formatter 0.22.0
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
GDScript formatter 0.21.0
A fast code formatter for GDScript in Godot 4.
Changelog
Added
- Implement automated line wrapping with a configurable max line length option (#187)
- Add EditorConfig support to share formatting settings across devices or a team (#244)
- Add option to preserve leading indentation within code blocks (#151)
- Add a way to disable the formatter on code regions (Thanks @discordier!)
- Allow configuring the number of blank lines between functions (#249)
- Allow configuring the number of extra indents in continuation lines
- Add support for files using Unicode identifiers (accents, Japanese, Chinese, Hebrew, etc.) (#255)
- Add an option to prefer a single or double quotes for strings (#193)
Changed
- Complete rewrite of the code formatter to make it more robust and much faster too (#250, #72)
- Refactor post-processing to use a visitor pattern with AST edits instead of regex-based processing (#220)
- Remove all
unwrap()calls from the project and follow stricter linting rules (#145) - Remove multiple third-party dependencies and greatly improve compilation speed
- Improve performance by an order of magnitude (10x to over 50x speedup depending on the case)
- Always lay enums vertically (one member per line) (#266)
Fixed
- Fix formatter issue with extra space in front of
class_name(#235) - Fix wrong
@annotationformatting inside an inner class (#245) - Fix
--reorder-codedetaching per-function@warning_ignore(...)from its function in scripts without aclass_name/extendsheader (#242) - Fix wrong region order in inner classes (#247)
- Fix
lint loop-variable-namefor unused variables (#225) - Fix
ifstatement and comment line getting dedented in nested code blocks (#190) - Fix formatting with vs without
--reorder-codenot being idempotent in some situations (#207) - Fix code inside dedented region comments getting dedented too: region comments will now indent into the code (#172)
- Fix dedented comment in a block's body (function body, loop body, if statement body...) causing following lines in the block to be dedented too (#252)
- Preserve up to 1 blank line between consecutive declarations when reordering (#268)
- Godot addon fixes:
Learn more about the formatter in the GDScript Formatter documentation
GDScript formatter 0.21.0-beta
A fast code formatter for GDScript in Godot 4.
You can learn how to install, use, configure, and integrate the formatter into your workflow on this page:
GDScript formatter 0.20.1
A fast code formatter for GDScript in Godot 4.
You can learn how to install, use, configure, and integrate the formatter into your workflow on this page:
GDScript formatter 0.20.0
A fast code formatter for GDScript in Godot 4.
You can learn how to install, use, configure, and integrate the formatter into your workflow on this page:
GDScript formatter 0.19.0
A fast code formatter for GDScript in Godot 4.
You can learn how to install, use, configure, and integrate the formatter into your workflow on this page: