Check everything at once
One command runs formatting, lint, type checking and code health, the same way everywhere.
gdsuite check runs the checks one after the other, and stops at the first
that finds a problem:
gdsuite checkpass: Formatting check passed (fmt, 10ms)
pass: Lint check passed (lint, 9ms)
pass: GDScript type check passed (typecheck, 289ms)
pass: Health checks passed (health, 78ms)Run it whenever you finish a change, before you commit. Run it in CI too: when it passes on your machine, it passes there.
The steps
| Step | What it does | It fails when | Fix it with |
|---|---|---|---|
fmt | Checks formatting, changes nothing | A script isn't formatted | gdsuite fmt |
lint | Runs the linter | A rule reports a problem | gdsuite lint -- --fix, then by hand |
typecheck | Runs the type check | Godot reports an error | By hand |
test | Runs your tests (not by default) | A test fails | By hand |
health | Measures code health | Code health could not run |
Tests are left out by default because they take longer than the rest. Run
gdsuite test separately, or add them:
# gdsuite.toml
[check]
steps = ["fmt", "lint", "typecheck", "test", "health"]Remove a step from the list to skip it, for example health while you set it
up.
When it fails
The failing step says what it found and how to fix it:
pass: Formatting check passed (fmt, 10ms)
error: Lint check failed (lint, 9ms)
test/test_player.gd:12:24 [duplicated-load] duplicated loading of "res://player/player.gd"
Found 1 lint problem. Fix them and rerun `gdsuite check`.
error: check failedFix, run gdsuite check again, and the next step runs.
In the Godot editor
The editor addon has a Check icon in the top bar: it runs the same steps, shows by its colour whether the project has errors or warnings, and lists each step's result in its tooltip.
For scripts and CI
gdsuite check --report json prints the result of every step as JSON and
saves it in reports/gdsuite/check.json. See Run it in CI and
Reports.