Skip to main content

Godot GDScript Architecture Guard

godot-gdscript-architecture-guard checks whether GDScript files still follow a small architecture policy. It is aimed at projects where autoloads, shared scripts, and feature modules can quietly become tangled during refactors.

It does not run the Godot editor. It scans .gd files and reports dependency direction, autoload access, unresolved res:// script/resource references, module owner summaries, high fan-in/fan-out from visible script references, and possible unused scripts/resources.

Install

python -m pip install godot-gdscript-architecture-guard

From a source checkout:

python -m pip install -e .\godot-gdscript-architecture-guard

Quick Start

godot-architecture-guard examples\tiny-architecture-project --config architecture-guard.toml

Write SARIF for code scanning:

godot-architecture-guard . --config architecture-guard.toml --format sarif --output reports\architecture.sarif

Write a Markdown refactor note:

godot-architecture-guard . --config architecture-guard.toml --format markdown --output reports\architecture.md --fail-on none

Markdown reports include owner summaries, dependency hotspots, possible unused files, and a Mermaid module dependency graph when configured modules reference each other. Use --format mermaid when you only want the graph.

Policy Example

[modules.ui]
paths = ["scripts/ui/**"]
may_depend_on = ["shared"]
allowed_autoloads = ["Settings"]

[modules.gameplay]
paths = ["scripts/gameplay/**"]
may_depend_on = ["shared"]
allowed_autoloads = ["GameState"]

[modules.shared]
paths = ["scripts/shared/**"]
may_depend_on = []
allowed_autoloads = []

[autoloads]
names = ["GameState", "Settings"]

If scripts/ui/menu.gd preloads res://scripts/gameplay/inventory.gd, the tool reports a module boundary violation unless ui may depend on gameplay.

If a configured module path matches no scripts, the tool reports that stale policy path as a warning. JSON, text, and Markdown reports also include advisory sections for module ownership, files with many visible script references, and scripts or resources that do not appear in visible res:// references. Script checks also treat class_name declarations as public entry points.

Outputs

  • text: local terminal report.
  • json: CI and scripts.
  • markdown: PR comments and review notes.
  • sarif: GitHub code scanning.
  • mermaid: dependency graph.

JSON reports include metadata, rule_help, and per-finding suggestions so CI jobs and small review scripts can explain the issue without hard-coding rule text. They also include owner_summaries, hotspots, and possible_unused_scripts / possible_unused_resources arrays for refactor review. Markdown reports embed the same module graph that --format mermaid writes as a standalone artifact. SARIF output carries rule descriptions for code scanning tools.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

godot_gdscript_architecture_guard-0.1.5.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file godot_gdscript_architecture_guard-0.1.5.tar.gz.

File metadata

File hashes

Hashes for godot_gdscript_architecture_guard-0.1.5.tar.gz
Algorithm Hash digest
SHA256 47d974073c7af9cd22054023333a18ac86e947c4c631fa4dcdd0253f6397f8e5
MD5 081f5e07cc6444cbbc0da87e6205b07d
BLAKE2b-256 8b0e6bfb14e9ed4bbef9c913a199b1462fa5bdf7d170ea0631b4975cf625f332

See more details on using hashes here.

Provenance

The following attestation bundles were made for godot_gdscript_architecture_guard-0.1.5.tar.gz:

Publisher: publish-gdscript-architecture-guard.yml on NonniGB/godot-production-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file godot_gdscript_architecture_guard-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for godot_gdscript_architecture_guard-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 63af7c5932d05f29f79915181b3d5553a244f4905b07108aa9d9670e04d724c8
MD5 3999f103c79de363af1db59bee466eea
BLAKE2b-256 e4e021540a8443e3ab4bac33255e3234a267d2f5333db3f42e23d6f30ef6bc17

See more details on using hashes here.

Provenance

The following attestation bundles were made for godot_gdscript_architecture_guard-0.1.5-py3-none-any.whl:

Publisher: publish-gdscript-architecture-guard.yml on NonniGB/godot-production-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page