v0.1.1
gdstyle 0.1.1
Small follow-up to the initial release: one false-positive fix and a
pre-commit integration that came out of community feedback.
Fixes
quality/no-self-assignno longer flagsobj.field = fieldstyle
assignments. The previous implementation compared one identifier on
each side of=, somoon.size = size * 0.5matchedsize == size
even though the LHS is the propertymoon.sizeand the RHS is the
localsize. Same bug hitself.position = positionand
x = x + 1. The rule now compares full dotted paths (including
self./super.heads) and only flags when the assignment ends
at a statement terminator. True positives like
obj.foo = obj.fooandself.player.health = self.player.health
still trigger.
Added
-
Pre-commit framework integration. gdstyle now ships a
.pre-commit-hooks.yamlat the repo root, exposing two hooks for
pre-commit:gdstyle(lint) and
gdstyle-fmt(format in place). Drop this into your project's
.pre-commit-config.yaml:repos: - repo: https://github.com/atelico/gdstyle rev: v0.1.1 hooks: - id: gdstyle - id: gdstyle-fmt
Then
pre-commit install. First run builds gdstyle from source via
cargo (Rust toolchain required); subsequent runs are cached.
Install
CLI from crates.io:
cargo install gdstyleOr grab a prebuilt binary from this release page, drop it on your PATH,
and run gdstyle in your project directory.
For the Godot editor plugin: download gdstyle-godot-plugin.zip from
this release, extract the addons/gdstyle/ folder into your Godot
project, then enable the plugin in Project > Project Settings > Plugins.
Full documentation, rule list, configuration reference, and the
GDExtension API live in the README.
Full Changelog: https://github.com/atelico/gdstyle/commits/v0.1.1