A strict GDScript linter enforcing Godot coding standards and best practices.
Designed to help teams maintain consistent code style, catch common mistakes, and enforce static typing.
- Enforces snake_case for variables and functions.
- Enforces PascalCase for class names.
- Enforces UPPER_SNAKE_CASE for constants.
- Ensures signals are snake_case and fully typed.
- Checks @onready and @export variables for proper typing.
- Optional enforcement of the
p_
prefix on function parameters.
Add to your .pre-commit-config.yaml
:
- repo: https://github.com/raincuhh/gd_strict_linter
rev: v0.1.5
hooks:
- id: gd-strict-linter
name: GD Strict Linter
entry: gd_strict_linter --p-prefix
language: python
types: [gdscript]
pass_filenames: false
- Variables:
snake_case
(private variables use_leading_underscore
) - Functions:
snake_case
, fully typed, optionalp_
prefix for parameters - Signals:
snake_case
with typed parameters - Class names:
PascalCase
- Constants:
UPPER_SNAKE_CASE
- Onready / Exported vars: must be typed
Contributions are welcome! Open an issue or a pull request if you find bugs or want new features.
MIT License. See LICENSE for details.