Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

pretty.gd for Godot

An asset by poeticAndroid
The page banner background of a mountain and forest
pretty.gd for Godot hero image

Quick Information

0 ratings
pretty.gd for Godot icon image
poeticAndroid
pretty.gd for Godot

A formatter for GDScript that just works!No Python! No binaries! No dependencies!Important!: Make sure to backup or commit your code before installing!

Supported Engine Version
4.0
Version String
0.5
License Version
MIT
Support Level
community
Modified Date
4 days ago
Git URL
Issue URL

pretty.gd for Godot

README pretty godot

A formatter for GDScript that just works!

No Python! No binaries! No dependencies!

Usage

Godot editor

  1. Backup or commit your code first, just in case!
  2. Install the plugin in the res://addons/ folder.
  3. Enable the plugin in project settings.
  4. Adjust editor settings to your liking.

README Editor Settings window

  1. Profit! Your GDScripts will be prettified automatically when you save.

GDScript API

Example

extends Node

var Prettifier = preload("res://addons/pretty-gd/pretty.gd").new()

func _ready():
    # configure indentation
    Prettifier.indent_str = "\t"
    Prettifier.tab_size = 4

    let filename = "my_script.gd"
    let input = FileAccess.get_file_as_string(filename)

    let output = Prettifier.prettify(input) # <- This is the main function

    var file = FileAccess.open(filename, FileAccess.WRITE)
    file.store_string(output)
    file.close()

Known Issues

If you come across any other issues with using this software, please let me know.

Release Notes

0.4

  • Tight prettification on line changes!
  • Atomic write when prettifying files.

0.3

  • Added setting to prettify editor on line changes.
  • Settings renamed pretty to prettify

0.2

  • Important bugfixes to the tokenizer!
  • More granular controls in the editor settings.

0.1

  • First release! 🎉

A formatter for GDScript that just works!

No Python! No binaries! No dependencies!

Important!: Make sure to backup or commit your code before installing!

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
pretty.gd for Godot icon image
poeticAndroid
pretty.gd for Godot

A formatter for GDScript that just works!No Python! No binaries! No dependencies!Important!: Make sure to backup or commit your code before installing!

Supported Engine Version
4.0
Version String
0.5
License Version
MIT
Support Level
community
Modified Date
4 days ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers