This file documents the changes made to the formatter with each release.
- Backslash line continuations are now indented with 2 extra levels, following the official GDScript style guide (#218)
- Bitwise binary operators (
&,|,^,~,<<,>>) are now accounted for in line wrapping (#213) - Godot addon: restored the lint icon in the left column (#206)
- Godot addon: added an option to select ignore directories for format-on-save (#191)
- Reorder: added support for
Controlvirtual built-in methods, refactored to be a bit less wasteful (#184) - Reorder: Added
_unhandled_key_input()to the list of built-in functions (#194)
- Regression: multiline lambda indentation broken when there were blank lines before (#219)
- Godot addon: fixed error when format-on-save is enabled and a tool script is actively running (#196)
- Godot addon: fixed lint results being parsed incorrectly on Windows (#200)
- Godot addon: fixed plugin menu button style to match other topbar buttons (#216)
- Godot addon: fixed lint line length and some lint rules being ignored (#178)
- README: updated project description, added features section, and updated installation instructions including Windows via Scoop (#203)
- README: fixed references from
gdscript-formattogdscript-formatter(#205)
- Reorder mode: region end comments being attached to the wrong function
- Formatting @abstract methods with trailing semicolons
if/elif/elsestatements on single lines wrapping incorrectly (#175)- Godot addon: support for non-English characters
- Godot addon: allow using both reorder code and safe mode together
- Safe mode: search for
extends_statementnode instead of accessing it by index (#174) - Multiline lambdas in ternaries having too much indentation and getting a parse error
- Remove version number from Godot addon zip in releases (it was breaking download links)
- Version number now included in release artifacts
- CI: updated the release workflow to ensure the build completes before creating a release
- Godot addon: Use standard output mode to avoid overwriting the file on disk
- Moved make_release and benchmark scripts to src/bin folder to avoid build errors
- Safe mode support for reorder code to verify syntax tree integrity after reordering
- Godot addon: safe mode is now enabled by default
- Improved handling of lists with leading commas and inline comments
- Reorder code: fixed inline comments wrapping to separate lines
- Added test case for comma after lambda function argument
- Icon for the program and the Godot addon
- Updated
topiary-coreto v0.7.0 - Updated GDScript parser; added test for comments inside dictionaries
- Safe mode: fixed panic when annotation doesn't have a name
- Fixed reorder mode dropping class-level
@abstractannotation - Fixed reorder mode dropping trailing comments and reordering comments in exported declarations
- Godot addon: fixed shortcut not working
- Added test case for indented comment at the end of a function body
- Applied clippy fixes
- Linting support to the Godot addon
- Instructions on how to use the formatter in VSCode to the README
- CI action to run tests on push
- CI job to package the Godot add-on to zip it automatically on releases
- Remove trailing whitespace when formatting (outside of strings)
- Removed alphabetic reordering when using the --reorder-code option
- Comment indentation test case
- Fixed an issue preventing the program from building and releasing the latest version.
max_term_widthconfiguration option now set to 120 characters by default
- Improved
--helpand-houtput for better clarity - Updated the tree-sitter GDScript parser to the latest version
- Function annotations now preserve input formatting and allow inline annotations with function definitions
- Safe mode no longer moves inline annotations in functions
- CI: Removed rust cache as it cannot work for the current build process
- Fixed issue with comments dedented from a function body causing next lines to be dedented too
- Fixed reorder mode dropping comments in one edge case (multiple commented lines at different indent levels at the end of a function)
- New
lintcommand with 17 code style and quality rules and warnings to help catch common issues - File name is now printed when formatting a single file
- Updated documentation to consistently use
gdscript-formatterinstead ofgdscript-format
- Annotations not being parsed correctly in safe mode
This release fixes issues with class docstring formatting and comments at the end of functions most notably.
- Idempotence checks to all tests to ensure formatted code remains unchanged when formatted again
- Test cases for trailing comments and await expressions
- Docstrings being incorrectly attached to classes instead of following statements during code reordering
- Comments at the very end of functions being incorrectly moved to a new line
- Await expressions being incorrectly formatted when used with
not
This release improves the formatter's performance by up to 10% compared to previous release, fixes several issues with safe mode, and refines the handling of docstrings and region.
- Formatting support for class documentation comments
- Improved spacing logic for inline comments in cases where we need to apply two lines of spacing
- Improved the performance of
class_nameandextendsqueries - Updated safe mode help message to warn about rare cases where it may not catch all formatting issues
- Safe mode incorrectly parsing
extendsstatements as children ofclass_namestatements #endregioncomments immediately following#regioncomments being collapsed- Missing empty lines between class documentation comments and following statements
- Multiple empty lines after
extendsstatements (now we ensure there is only one empty line) - Godot add-on: Download URL for Windows users failing due to incorrect file extension
- Failing reorder test cases were cleaned up and corrected
- Restored and added code reordering test cases
- Edge cases with class name and extend wrapping not being enforced on two lines
- Reorder mode dropping region comments and RPC annotations
- Some multiline strings being parsed incorrectly
- Class docstring first line being moved incorrectly during reordering
- Typed dictionaries function return types not formatting correctly
- Region comments not attaching to the correct code block after reordering
This release introduces a Godot addon to integrate the formatter with the Godot editor and fixes several formatting edge cases.
- Godot addon in which you can:
- Install and uninstall the formatter directly from within the Godot editor
- Access issues and documentation
- Use the formatter, reorder code, and format on save
- Change formatter settings
- Reference to the AUR package in the README
- Changed formatting for
class_namedeclarations withextendsto wrap on two lines (following the official style guide)
- Newlines being incorrectly removed in multiline ternary expressions
- Formatting issues with
extendswhen the class name is under 3 characters long - Missing line returns between multiple match patterns on a single line
This is a minor release that adds Nix support and fixes several edge cases with output formatting and comma handling. It also prepares for support for the formatter from within Godot.
- Nix flake support to use the formatter on NixOS
- Release artifacts now only include zip files instead of both zip and tar.gz (this is needed to support auto-install in Godot)
- Removed cleanup for lines containing only whitespace
- Progress messages appearing in output when using the
--stdoutoption - Dangling commas sometimes being incorrectly moved inside strings
- Various edge cases in post-processing formatting
This release focuses on performance improvements and adds support for formatting multiple files at once.
- Support for formatting multiple files at once
- Multi-threading when formatting multiple files for better performance
- Improved performance on long GDScript files by 5 to 10%
- Don't parse code multiple times when using
--safeflag - Reuse parser instances and trees to reduce memory allocations
- Updated dependencies to latest versions
- Updated Zed editor configuration instructions
- Fixed commas ending up dangling on separate lines in some cases (after lambdas in function calls, arrays, and dictionaries)
- Don't modify original syntax tree for safety checks
- Shifted to a fork of the GDScript parser to allow addressing upstream issues sooner
- Incorrect formatting of functions defined inline with class definitions
- Space added in function parameter type inference
- Support for annotations in match patterns
- Support for conditional expressions in match statements
- Comments sometimes being aligned to the previous line indentation level instead of the current one in functions and classes
- Definitions inline with a class definition not being wrapped to a new line
This release adds a safe mode to help make the formatter more resilient, and adds configuration instructions to integrate it into Zed, Helix, and JetBrains Rider.
- Syntax tree verification option (
--safe) to catch formatting issues early - Instructions to integrate the formatter into JetBrains Rider
- Two blank lines between functions/inner classes and following variable, signal, enum, or constant declarations
- Space after bitwise NOT being incorrectly added
- Comma placement after multiline arrays
- Trailing comma being added to multiline preload calls (GDScript does not support trailing commas in this case)
This release brings two hotfixes and adds configuration instructions for two editors.
- Instructions to integrate the formatter into the Zed and Helix editors
- Regions being erased during formatting
- Inline comments in function calls being misplaced
This release improves formatting consistency for dictionaries, arrays, and function parameters, and fixes several edge cases related to variable declarations and class definitions.
- Space after comma between types in typed dictionary type hints
- Space after the opening brace and before closing braces of single line dictionaries
- Trailing commas in arrays, dictionaries, enums, and function parameters
- New line before enums closing brace
- Removed trailing comma in singleline arrays/dictionaries/enums/functions
- Variable declaration after function getting placed inside function (or class)
- Incorrect formatting when a declaration immediately follows an extends statement in an inner class
This release improves formatting consistency and fixes several edge cases related to spacing, comments, and function/class definitions.
- Space after commas in setter and getter declarations
- Two blank lines before annotated functions
- Improved the detection and removal of dangling semicolons
- Removed unnecessary topiary rule for
@toolannotations
- Functions with a single statement on a single line (e.g.,
func a(): pass) being incorrectly merged with the following function - Class definitions placed next to one another losing line breaks between them
- Inline comments after annotations being misplaced
- Comments in arrays and dictionaries being incorrectly formatted in some cases
- Comments in enums being misaligned in some cases
This release fixes critical bugs that could cause data loss during formatting.
- Formatting support for pattern guards (syntax:
a when b:) - Test cases for string literals to prevent regressions
- Added warning in README about using version control systems when formatting code to prevent data loss
- StringName strings (
&"TextHere") being erased during formatting - NodePath strings (
^"Path/To/Node") being erased during formatting
This release greatly improves the performance of the formatter, which makes it feel even snappier than before. The time to format is divided by up to 2.
- Support for multiline function calls with correct indentation
- Option to reorder GDScript code according to the official style guide
- Benchmark script to test the formatter's performance on small and large files (run
cargo run --bin benchmark --release)
- Updated GDScript tree-sitter parser and tree-sitter library to the latest version, bringing a big performance improvement (up to 30%)
- Optimized release builds with lto compile flags (this brings a 10-20% speed improvement)
- Improved vertical spacing between class-level declarations to add two lines even if there are docstrings
- Improved module documentation and docstrings
- Vertical spacing logic to account for multi-line comments/docstrings before definitions
- Refactored formatter to use more idiomatic Rust (the formatter is now a struct and multiline module comments are docstrings)
gdscript-formatteris now the default binary forcargo run
- Loss of node names/paths in
%and$ get_nodesyntaxes - Leading space before
notbeing lost during formatting in the expressionnot in - Line continuation markers being lost upon formatting
- Incorrect GitHub URLs in README (#15)
- Trailing comments at the end of functions were being wrapped on a new line. They're now preserved at the end of the function line.
- Updated to latest version of the GDScript parser with adapted queries for new body node in setters and getters
- Added test case for trailing comments at the end of functions to ensure correct formatting
- Print the help message if there are no arguments or piped input
- Semicolons: wrap statements on multiple lines when needed, preserve indentation in code blocks
- Inline comments after colons wrapping on another line
- Make tests run much 3 to 4x faster and greatly improve output diff
- Use cargo configuration to strip debug symbols from release binaries
- Support for multi-line wrapping of function parameters with extra indentation
- Spacing around the "as" keyword
- Formatter now overwrites formatted files by default instead of outputting to stdout
- Added option to output to stdout when needed
- Version number is now read directly from Cargo.toml at build time
This is the initial release of the GDScript formatter.
- Support for many GDScript formatting rules:
- Consistent spacing between operators, keywords, and after commas in most cases
- Single and multi-line formatting for arrays and dictionaries
- Consistent indentation for blocks, function definitions, and control structures
- Enforces blank lines between functions and classes
- Configuration option for indentation (spaces or tabs)
- Test suite with input/expected file pairs (run with
cargo test) - Cross-platform support (Linux, macOS, Windows) and automated builds with GitHub Actions