explaingit

atelico/gdstyle

17RustAudience · developerComplexity · 2/5Setup · easy

TLDR

A linter and auto-formatter for GDScript that checks Godot 4 scripts against 54 style rules covering naming, formatting, ordering, and code quality, and can fix most issues automatically including renames in scene files.

Mindmap

mindmap
  root((gdstyle))
    What it does
      Lint GDScript files
      Auto-format code
      Reorder class members
    Rule categories
      Naming conventions
      Formatting
      Code ordering
      Code quality
    Installation
      Static binary
      cargo install
      No Godot needed
    Usage
      Scan directory
      Fix flag
      CI JSON output
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Automatically fix naming and formatting violations across all .gd files in your Godot 4 project with one command.

USE CASE 2

Add gdstyle to a CI pipeline to block merges that violate the official Godot style guide, using JSON output mode.

USE CASE 3

Reorder class members in every script to the canonical Godot sequence (signals, constants, exports, variables, methods) automatically.

Tech stack

RustGDScriptTOML

Getting it running

Difficulty · easy Time to first run · 5min

Single static binary with no external dependencies, download a pre-built release for Linux, macOS, or Windows and run it directly, no Godot or Rust needed.

In plain English

gdstyle is a linter and formatter for GDScript, the scripting language used in the Godot game engine (version 4.x). The tool reads your .gd files and flags coding style violations, naming inconsistencies, and common code quality problems. It can also auto-format the code and reorder class members to match the official Godot style guide. The tool ships with 54 rules spread across five categories: syntax, naming, formatting, ordering, and code quality. Naming rules cover things like function names needing lowercase-with-underscores (snake_case) or class names needing PascalCase capitalization. Formatting rules handle spacing, quote style, trailing commas, blank lines, and indentation. Code quality rules flag functions that are too long, files that exceed a configurable line count, too many parameters on a function, and unused variables. Many rules can be auto-fixed by the tool, naming renames follow into other script files and into the .tscn scene files that wire up node connections. Installation is a single static binary with no external dependencies. You do not need Python, a Rust compiler, or even Godot itself installed to run gdstyle. Pre-built binaries are available for Linux, macOS (both Intel and Apple Silicon), and Windows. It can also be installed through Rust's package manager with cargo install gdstyle, or built from source. Running gdstyle with no arguments scans all .gd files in the current directory recursively. The --fix flag applies safe auto-fixes in place, while --unsafe-fix handles renames. The fmt subcommand reformats files and reorders class members into the canonical Godot sequence, putting signals before constants, then exported variables, then regular variables, then methods. JSON output is available for CI pipelines. Per-project configuration lives in a gdstyle.toml file. Individual rule violations can also be suppressed inline with a comment.

Copy-paste prompts

Prompt 1
I have a Godot 4 project with many .gd files. Run gdstyle --fix on the whole directory and explain which rules it applied and which ones need manual review.
Prompt 2
Add gdstyle JSON output to my GitHub Actions CI so pull requests fail if any GDScript naming or formatting rule is violated.
Prompt 3
I want to suppress a specific gdstyle rule for one function in my GDScript file. Show me the inline comment syntax to disable that rule locally.
Prompt 4
I ran gdstyle --unsafe-fix on my project. Walk me through what renames it made across .gd and .tscn files and how to verify nothing broke.
Open on GitHub → Explain another repo

← atelico on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.