gdlint

GDSCRIPT / PROJECT HYGIENE

A cleaner
next commit.

Catch the debug prints, stray pass statements, orphaned UIDs and indentation issues before they become the leftovers.

Get gdlint ↗ curl -fsSL https://gdlint.dev/install | sh
REVIEW / EXAMPLE.GD GODOT 4
1 2 3 4
func _ready() -> void:
    print("debug: ready")
    start_game()
!
Debug print found

print_statements · enabled by default

CHECK THE PROJECT $ gdlint → REVIEW THE REPORT

Illustrative check. Review the report before using -fix.

SENSIBLE FIRST CHECKS

Four on.
The rest, your call.

A fresh project gets four checks. Enable the deeper unused-code and typing rules when they fit your conventions.

01
print_statements

print() and debug output left behind

✓
02
pass_statements

pass in a body that already has statements

✓
03
orphaned_uids

a .gd.uid whose script is gone

✓
04
indentation

spaces where GDScript indents with tabs

✓

gdlint init

Every rule, and what it ships as.

gdlint init writes this list into gdlint.json with the defaults below. Errors block and exit non-zero; warnings only appear under -warn. Files can be excluded wholesale, or only from the unused-code rules, or only from the Variant rule.

-fix acts on the errors — it deletes functions, signals, constants and whole files that static analysis believes are unused. Reflection, a string-built call() or a resource path assembled at runtime is invisible to it. Turn the unused rules on, read what they report, and keep the change reviewable.

Rule Catches Default
print_statements print() and debug output left behind on
pass_statements pass in a body that already has statements on
orphaned_uids a .gd.uid whose script is gone on
indentation spaces where GDScript indents with tabs on
unused_functions functions nothing calls off
unused_signals signals nothing connects or emits off
unused_constants constants nothing reads off
unused_enums enums and enum values nothing reads off
unused_class_names class_name nothing refers to off
unused_files scripts no script, scene or autoload points at off
comments comments outside the allowed prefixes off
has_method dynamic dispatch instead of a typed call off
variant_usage explicit Variant in a signature off
missing_return_types public functions with no return annotation off
single_use_functions warning functions with exactly one caller off
empty_functions warning functions with nothing in them off

KEEP THE CHANGE REVIEWABLE

Make room for
what your game needs.

A single binary for Linux, macOS and Windows. Run a check locally or use it to keep your project honest in CI.

Read the guide ↗