A GDScript beautifier for Godot Engine
This addon is compatible with Godot 4.
GDBeautifier performs several optional cleaning tasks.
- Removes spaces and tabs in empty lines
- Removes spaces at the end of lines
- Removes empty lines at the end of a script
- Adds spaces around operators, with the option of ignoring '/' symbols in $node references †
- Adds a space after commas and colons
- Adds 1 or 2 empty lines before any function
† $node references are assumed to start with $ and end with either . = : tab space or EOL
The addon ignores anything inside strings and comments.
Add the addons folder to your project, and enable it in the plugins panel of the project settings.
The beautifier panel is in the top left dock. It appears when the script editor is visible and a script is selected. Select the desired options and click on beautify. The current script will be beautified. You can undo if you change your mind.