Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
Automatically formats and lints GDScript files on save using gdformat and gdlint.
Beautify Code on Save
A Godot 4 plugin that automatically formats and lints your GDScript files when saving.
Features
- Automatic code formatting using
gdformatwhen saving files - Code style checking with
gdlintafter formatting - Maintains cursor and scroll position
- Configurable paths for both tools
- Automatic tool path detection
- Clean error reporting
Prerequisites
You need to have
gdtoolkitinstalled. For installation instructions, visit: https://github.com/Scony/godot-gdscript-toolkitMake sure both
gdformatandgdlintare available in your system after installation.
Installation
- Clone this repository (or download it) into your project's
addonsfolder:
cd your-project
git clone https://github.com/nuevocharrua/beautify-code-on-save addons/beautify_code_on_save
- Enable the plugin in Godot:
- Go to Project -> Project Settings -> Plugins
- Find "Beautify Code on Save" in the list
- Check the "Enable" checkbox
Configuration
The plugin will try to automatically detect the paths to gdformat and gdlint. If it cannot find them, you can configure them manually:
- Go to Editor -> Editor Settings
- Scroll down to the "Beautify Code on Save" section
- Set the paths for both tools
Common paths are:
- Linux/macOS:
/usr/local/bin/gdformator~/.local/bin/gdformat - Windows: Usually in
%APPDATA%\Python\Scripts\gdformat.exe
Usage
Just save your GDScript files (Ctrl+S/Cmd+S) and they will be automatically formatted and checked!
License
MIT License - See LICENSE file for details
Automatically formats and lints GDScript files on save using gdformat and gdlint.
Reviews
Quick Information
Automatically formats and lints GDScript files on save using gdformat and gdlint.