Lava abgeschwächt, Archetypen aus Datei mit CI-Messlauf, Kartentext folgt Schriftgröße, Gamepad in Menüs, Anleitung 2 mit sicherem Angriff, Übersetzungsprüfung, Lint und gestaffelte CI
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QPgKvy5W9WRNFHjkm5QsHx
This commit is contained in:
29
tests/lint.gd
Normal file
29
tests/lint.gd
Normal file
@@ -0,0 +1,29 @@
|
||||
extends SceneTree
|
||||
## Statische Prüfung: lädt jedes Skript; Parse- oder Kompilierfehler lassen den Lauf scheitern.
|
||||
## godot --headless --path . -s tests/lint.gd
|
||||
|
||||
|
||||
func scan(dir: String, out: Array) -> void:
|
||||
var d := DirAccess.open(dir)
|
||||
if d == null:
|
||||
return
|
||||
for sub in d.get_directories():
|
||||
if not sub.begins_with("."):
|
||||
scan(dir.path_join(sub), out)
|
||||
for f in d.get_files():
|
||||
if f.ends_with(".gd"):
|
||||
out.append(dir.path_join(f))
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
var files := []
|
||||
for dir in ["res://scripts", "res://tests"]:
|
||||
scan(dir, files)
|
||||
var bad := 0
|
||||
for path in files:
|
||||
var script = load(path)
|
||||
if script == null or not (script is GDScript):
|
||||
printerr("FEHLER: %s lädt nicht" % path)
|
||||
bad += 1
|
||||
print("%d Skripte geprüft, %d fehlerhaft" % [files.size(), bad])
|
||||
quit(1 if bad > 0 else 0)
|
||||
Reference in New Issue
Block a user