Skip to content

PromisedRain/godot-strict-linter

Repository files navigation

GD Strict Linter

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.


Features

  • 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.

Pre-commit integration

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

Coding Standards Enforced

  1. Variables: snake_case (private variables use _leading_underscore)
  2. Functions: snake_case, fully typed, optional p_ prefix for parameters
  3. Signals: snake_case with typed parameters
  4. Class names: PascalCase
  5. Constants: UPPER_SNAKE_CASE
  6. Onready / Exported vars: must be typed

Contributing

Contributions are welcome! Open an issue or a pull request if you find bugs or want new features.


License

MIT License. See LICENSE for details.

About

a strict godot linter for use in pre-commit hooks and manual linting

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages