gdharness 1.1.22 → 1.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +452 -219
- package/build/godot/addons/gdharness_editor/bridge_client.gd +12 -2
- package/build/godot/addons/gdharness_runtime/runtime_autoload.gd +7 -1
- package/build/godot/addons/gdharness_runtime/runtime_capture.gd +51 -5
- package/build/godot/addons/gdharness_runtime/runtime_changes.gd +2 -2
- package/build/godot/addons/gdharness_runtime/runtime_paths.gd +61 -8
- package/build/godot/addons/gdharness_runtime/runtime_queries.gd +105 -49
- package/build/godot/addons/gdharness_runtime/runtime_waits.gd +41 -19
- package/build/godot/operations/classdb_queries.gd +28 -17
- package/build/godot/operations/project_diagnostics.gd +2 -1
- package/build/index.js +442 -124
- package/build/keeper.js +4 -0
- package/package.json +1 -1
|
@@ -3,18 +3,22 @@ extends RefCounted
|
|
|
3
3
|
const Read = preload("reading.gd")
|
|
4
4
|
const Log = preload("logger.gd")
|
|
5
5
|
|
|
6
|
-
# The base
|
|
6
|
+
# The base classes each category name stands for. Kept to the list the tool's schema offers, which
|
|
7
|
+
# a case holds: the schema offered physics3d and ui, which this refused, and physics answered the 3D
|
|
8
|
+
# bodies alone beside physics2d and physics3d.
|
|
7
9
|
const CATEGORY_BASES: Dictionary = {
|
|
8
|
-
"node": "Node",
|
|
9
|
-
"node2d": "Node2D",
|
|
10
|
-
"node3d": "Node3D",
|
|
11
|
-
"control": "Control",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
10
|
+
"node": ["Node"],
|
|
11
|
+
"node2d": ["Node2D"],
|
|
12
|
+
"node3d": ["Node3D"],
|
|
13
|
+
"control": ["Control"],
|
|
14
|
+
"ui": ["Control"],
|
|
15
|
+
"resource": ["Resource"],
|
|
16
|
+
"physics": ["PhysicsBody2D", "PhysicsBody3D"],
|
|
17
|
+
"physics2d": ["PhysicsBody2D"],
|
|
18
|
+
"physics3d": ["PhysicsBody3D"],
|
|
19
|
+
"audio": ["AudioStream"],
|
|
20
|
+
"visual": ["VisualInstance3D"],
|
|
21
|
+
"animation": ["AnimationMixer"],
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
var _log: Log
|
|
@@ -24,6 +28,14 @@ func _init(p_log: Log) -> void:
|
|
|
24
28
|
_log = p_log
|
|
25
29
|
|
|
26
30
|
|
|
31
|
+
static func _under_any(name: String, bases: Array) -> bool:
|
|
32
|
+
for base: Variant in bases:
|
|
33
|
+
var base_name: String = str(base)
|
|
34
|
+
if name == base_name or ClassDB.is_parent_class(name, base_name):
|
|
35
|
+
return true
|
|
36
|
+
return false
|
|
37
|
+
|
|
38
|
+
|
|
27
39
|
# Query available classes from ClassDB with optional filtering
|
|
28
40
|
func query_classes(params: Dictionary) -> Dictionary:
|
|
29
41
|
var filter: String = str(params.get("filter", ""))
|
|
@@ -42,10 +54,10 @@ func query_classes(params: Dictionary) -> Dictionary:
|
|
|
42
54
|
)
|
|
43
55
|
)
|
|
44
56
|
|
|
45
|
-
var
|
|
57
|
+
var bases: Array = []
|
|
46
58
|
if not category.is_empty():
|
|
47
|
-
|
|
48
|
-
if
|
|
59
|
+
bases = CATEGORY_BASES.get(category.to_lower(), [])
|
|
60
|
+
if bases.is_empty():
|
|
49
61
|
return _log.failure("Unknown category: " + category + ". Valid: " + str(CATEGORY_BASES.keys()))
|
|
50
62
|
|
|
51
63
|
var all_classes: PackedStringArray = ClassDB.get_class_list()
|
|
@@ -60,9 +72,8 @@ func query_classes(params: Dictionary) -> Dictionary:
|
|
|
60
72
|
if not filter.is_empty() and not class_name_str.to_lower().contains(filter.to_lower()):
|
|
61
73
|
continue
|
|
62
74
|
|
|
63
|
-
if not
|
|
64
|
-
|
|
65
|
-
continue
|
|
75
|
+
if not bases.is_empty() and not _under_any(class_name_str, bases):
|
|
76
|
+
continue
|
|
66
77
|
|
|
67
78
|
filtered_classes.append(class_name_str)
|
|
68
79
|
|
|
@@ -106,7 +106,8 @@ func get_project_health(params: Dictionary) -> Dictionary:
|
|
|
106
106
|
if "scenes" in check_categories:
|
|
107
107
|
var details: Array[String] = []
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
# Binary scenes too, which a project may save instead and which counted as none.
|
|
110
|
+
var scene_files: Array[String] = _files.find_files_with_extensions("res://", ["tscn", "scn"])
|
|
110
111
|
if scene_files.size() == 0:
|
|
111
112
|
details.append("No scene files found in project")
|
|
112
113
|
deductions += 5
|