gdharness 1.3.41 → 1.3.43

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.
Files changed (107) hide show
  1. package/build/cli.js +131 -47
  2. package/build/godot/addons/auto_reload/auto_reload.gd +18 -19
  3. package/build/godot/addons/gdharness_editor/animation_reads.gd +84 -35
  4. package/build/godot/addons/gdharness_editor/bridge_client.gd +53 -58
  5. package/build/godot/addons/gdharness_editor/declared_values.gd +68 -32
  6. package/build/godot/addons/gdharness_editor/file_reads.gd +114 -39
  7. package/build/godot/addons/gdharness_editor/file_walk.gd +12 -5
  8. package/build/godot/addons/gdharness_editor/headless_check.gd +94 -41
  9. package/build/godot/addons/gdharness_editor/plugin.gd +2 -3
  10. package/build/godot/addons/gdharness_editor/property_paths.gd +22 -12
  11. package/build/godot/addons/gdharness_editor/property_values.gd +143 -78
  12. package/build/godot/addons/gdharness_editor/reading.gd +37 -12
  13. package/build/godot/addons/gdharness_editor/same_values.gd +4 -4
  14. package/build/godot/addons/gdharness_editor/scene_file.gd +136 -79
  15. package/build/godot/addons/gdharness_editor/scene_uids.gd +12 -6
  16. package/build/godot/addons/gdharness_editor/serialisation.gd +75 -51
  17. package/build/godot/addons/gdharness_editor/setting_reads.gd +7 -6
  18. package/build/godot/addons/gdharness_editor/tool_executor.gd +3 -6
  19. package/build/godot/addons/gdharness_editor/tools/animation_states.gd +41 -28
  20. package/build/godot/addons/gdharness_editor/tools/animation_tools.gd +84 -50
  21. package/build/godot/addons/gdharness_editor/tools/animation_tracks.gd +70 -40
  22. package/build/godot/addons/gdharness_editor/tools/class_tools.gd +34 -30
  23. package/build/godot/addons/gdharness_editor/tools/filesystem_tools.gd +24 -22
  24. package/build/godot/addons/gdharness_editor/tools/navigation_bake.gd +49 -29
  25. package/build/godot/addons/gdharness_editor/tools/play_tools.gd +26 -21
  26. package/build/godot/addons/gdharness_editor/tools/profile_tools.gd +40 -40
  27. package/build/godot/addons/gdharness_editor/tools/resource_tools.gd +181 -107
  28. package/build/godot/addons/gdharness_editor/tools/scene_groups.gd +16 -9
  29. package/build/godot/addons/gdharness_editor/tools/scene_kin.gd +75 -43
  30. package/build/godot/addons/gdharness_editor/tools/scene_paths.gd +35 -20
  31. package/build/godot/addons/gdharness_editor/tools/scene_placing.gd +28 -13
  32. package/build/godot/addons/gdharness_editor/tools/scene_sharing.gd +66 -0
  33. package/build/godot/addons/gdharness_editor/tools/scene_sharing.gd.uid +1 -0
  34. package/build/godot/addons/gdharness_editor/tools/scene_tools.gd +171 -62
  35. package/build/godot/addons/gdharness_editor/tools/script_paths.gd +20 -8
  36. package/build/godot/addons/gdharness_editor/tools/settings_tools.gd +11 -8
  37. package/build/godot/addons/gdharness_editor/tools/signal_tools.gd +47 -34
  38. package/build/godot/addons/gdharness_editor/tools/tileset_tools.gd +77 -50
  39. package/build/godot/addons/gdharness_editor/value_shapes.gd +5 -6
  40. package/build/godot/addons/gdharness_runtime/call_errors.gd +1 -2
  41. package/build/godot/addons/gdharness_runtime/declared_values.gd +68 -32
  42. package/build/godot/addons/gdharness_runtime/error_report.gd +1 -2
  43. package/build/godot/addons/gdharness_runtime/reading.gd +37 -12
  44. package/build/godot/addons/gdharness_runtime/runtime_accessibility.gd +84 -63
  45. package/build/godot/addons/gdharness_runtime/runtime_autoload.gd +153 -148
  46. package/build/godot/addons/gdharness_runtime/runtime_capture.gd +64 -42
  47. package/build/godot/addons/gdharness_runtime/runtime_changes.gd +184 -122
  48. package/build/godot/addons/gdharness_runtime/runtime_frames.gd +2 -2
  49. package/build/godot/addons/gdharness_runtime/runtime_hover.gd +24 -20
  50. package/build/godot/addons/gdharness_runtime/runtime_input.gd +134 -92
  51. package/build/godot/addons/gdharness_runtime/runtime_items.gd +29 -13
  52. package/build/godot/addons/gdharness_runtime/runtime_menus.gd +0 -1
  53. package/build/godot/addons/gdharness_runtime/runtime_mouse.gd +38 -20
  54. package/build/godot/addons/gdharness_runtime/runtime_pad.gd +17 -13
  55. package/build/godot/addons/gdharness_runtime/runtime_paths.gd +84 -46
  56. package/build/godot/addons/gdharness_runtime/runtime_queries.gd +117 -79
  57. package/build/godot/addons/gdharness_runtime/runtime_says.gd +14 -17
  58. package/build/godot/addons/gdharness_runtime/runtime_screen.gd +23 -16
  59. package/build/godot/addons/gdharness_runtime/runtime_targets.gd +117 -66
  60. package/build/godot/addons/gdharness_runtime/runtime_touch.gd +211 -0
  61. package/build/godot/addons/gdharness_runtime/runtime_touch.gd.uid +1 -0
  62. package/build/godot/addons/gdharness_runtime/runtime_typing.gd +44 -27
  63. package/build/godot/addons/gdharness_runtime/runtime_values.gd +108 -73
  64. package/build/godot/addons/gdharness_runtime/runtime_waits.gd +111 -84
  65. package/build/godot/addons/gdharness_runtime/runtime_words.gd +10 -7
  66. package/build/godot/addons/gdharness_runtime/serialisation.gd +75 -51
  67. package/build/godot/addons/gdharness_runtime/value_shapes.gd +5 -6
  68. package/build/godot/addons/gdharness_tests/bench.gd +4 -5
  69. package/build/godot/addons/gdharness_tests/event.gd +10 -5
  70. package/build/godot/addons/gdharness_tests/share.gd +38 -18
  71. package/build/godot/addons/gdharness_tests/suites.gd +3 -3
  72. package/build/godot/addons/gdharness_tests/wait.gd +3 -2
  73. package/build/godot/loader/loader.gd +9 -9
  74. package/build/godot/operations/animation_reads.gd +84 -35
  75. package/build/godot/operations/audio_buses.gd +48 -19
  76. package/build/godot/operations/class_cache.gd +16 -11
  77. package/build/godot/operations/classdb_queries.gd +89 -44
  78. package/build/godot/operations/declared_values.gd +68 -32
  79. package/build/godot/operations/dependencies.gd +139 -93
  80. package/build/godot/operations/editor_tools.gd +9 -10
  81. package/build/godot/operations/export_presets.gd +100 -54
  82. package/build/godot/operations/file_reads.gd +114 -39
  83. package/build/godot/operations/file_walk.gd +12 -5
  84. package/build/godot/operations/gdscript_analysis.gd +105 -66
  85. package/build/godot/operations/gdscript_authoring.gd +138 -39
  86. package/build/godot/operations/godot_operations.gd +17 -11
  87. package/build/godot/operations/import_pipeline.gd +110 -59
  88. package/build/godot/operations/input_actions.gd +63 -39
  89. package/build/godot/operations/patterns.gd +3 -1
  90. package/build/godot/operations/plugins.gd +36 -16
  91. package/build/godot/operations/project_config.gd +144 -27
  92. package/build/godot/operations/project_diagnostics.gd +24 -11
  93. package/build/godot/operations/project_file.gd +16 -16
  94. package/build/godot/operations/project_validation.gd +71 -44
  95. package/build/godot/operations/property_paths.gd +22 -12
  96. package/build/godot/operations/property_values.gd +143 -78
  97. package/build/godot/operations/reading.gd +37 -12
  98. package/build/godot/operations/rename_checks.gd +2 -2
  99. package/build/godot/operations/resource_files.gd +11 -9
  100. package/build/godot/operations/same_values.gd +4 -4
  101. package/build/godot/operations/scene_connections.gd +27 -13
  102. package/build/godot/operations/script_check.gd +52 -49
  103. package/build/godot/operations/serialisation.gd +75 -51
  104. package/build/godot/operations/setting_reads.gd +7 -6
  105. package/build/godot/operations/value_shapes.gd +5 -6
  106. package/build/godot/tests/listed.gd +321 -268
  107. package/package.json +1 -1
@@ -1,5 +1,4 @@
1
1
  extends RefCounted
2
-
3
2
  ## Whether a project is ready to run and export: its settings, main scene, imports, presets,
4
3
  ## scripts, references and signal connections, each named under checks_performed.
5
4
 
@@ -13,7 +12,8 @@ const GdhRead = preload("reading.gd")
13
12
  const GdhSceneConnections = preload("scene_connections.gd")
14
13
  const GdhScriptCheck = preload("script_check.gd")
15
14
  const CONNECTION_FIX: String = (
16
- "Write the method or signal, or point the connection at the one that replaced it with" + " scene_signal"
15
+ "Write the method or signal, or point the connection at the one that replaced it with"
16
+ + " scene_signal"
17
17
  )
18
18
 
19
19
  var _log: GdhLog
@@ -28,7 +28,9 @@ func validate_project(params: Dictionary) -> Dictionary:
28
28
  var preset_name: String = str(params.get("preset", ""))
29
29
  var include_suggestions: bool = GdhRead.as_bool(params.get("include_suggestions", true), true)
30
30
 
31
- _log.info("Validating project" + (" for preset: " + preset_name if not preset_name.is_empty() else ""))
31
+ _log.info(
32
+ "Validating project" + (" for preset: " + preset_name if not preset_name.is_empty() else "")
33
+ )
32
34
 
33
35
  var issues: Array[Dictionary] = []
34
36
  var warnings: Array[Dictionary] = []
@@ -73,18 +75,24 @@ func validate_project(params: Dictionary) -> Dictionary:
73
75
  # a scene using one fails to load in a run or an export.
74
76
  checks_performed.append("imports")
75
77
  var never: Array[String] = []
76
- for path: String in _files.find_files_with_extensions("res://", GdhImportPipeline.IMPORTABLE_EXTENSIONS):
78
+ for path: String in _files.find_files_with_extensions(
79
+ "res://", GdhImportPipeline.IMPORTABLE_EXTENSIONS
80
+ ):
77
81
  if not FileAccess.file_exists(path + ".import"):
78
82
  never.append(path)
79
83
  if not never.is_empty():
80
84
  never.sort()
81
- warnings.append(
82
- _finding(
83
- "warning",
84
- "imports",
85
- GdhImportPipeline.never_imported_line(never),
86
- "Run project_import reimport, or open the project in the editor, whose scan imports them",
87
- include_suggestions
85
+ (
86
+ warnings
87
+ . append(
88
+ _finding(
89
+ "warning",
90
+ "imports",
91
+ GdhImportPipeline.never_imported_line(never),
92
+ "Run project_import reimport, or open the project in the editor, whose scan "
93
+ + "imports them",
94
+ include_suggestions
95
+ )
88
96
  )
89
97
  )
90
98
 
@@ -106,33 +114,44 @@ func validate_project(params: Dictionary) -> Dictionary:
106
114
  checks_performed.append("export_preset")
107
115
  var named: Array[String] = GdhExportPresets.names()
108
116
  if preset_name not in named:
109
- issues.append(
110
- _finding(
111
- "error",
112
- "export_preset",
113
- (
114
- "No export preset is named "
115
- + preset_name
116
- + (
117
- ": the project has none"
118
- if named.is_empty()
119
- else ": the presets are " + ", ".join(named)
120
- )
121
- ),
122
- "Pass one of the preset names, or add the preset with project_export add_preset",
123
- include_suggestions
117
+ (
118
+ issues
119
+ . append(
120
+ _finding(
121
+ "error",
122
+ "export_preset",
123
+ (
124
+ "No export preset is named "
125
+ + preset_name
126
+ + (
127
+ ": the project has none"
128
+ if named.is_empty()
129
+ else ": the presets are " + ", ".join(named)
130
+ )
131
+ ),
132
+ "Pass one of the preset names, or add the preset with project_export "
133
+ + "add_preset",
134
+ include_suggestions
135
+ )
124
136
  )
125
137
  )
126
138
  else:
127
139
  var gone: Array[String] = GdhExportPresets.missing_named(preset_name)
128
140
  if not gone.is_empty():
129
- warnings.append(
130
- _finding(
131
- "warning",
132
- "export_preset_files",
133
- "The preset %s names files that are not there: %s" % [preset_name, "; ".join(gone)],
134
- "Add the files, or point the options at others with project_export set_preset",
135
- include_suggestions
141
+ (
142
+ warnings
143
+ . append(
144
+ _finding(
145
+ "warning",
146
+ "export_preset_files",
147
+ (
148
+ "The preset %s names files that are not there: %s"
149
+ % [preset_name, "; ".join(gone)]
150
+ ),
151
+ "Add the files, or point the options at others with project_export "
152
+ + "set_preset",
153
+ include_suggestions
154
+ )
136
155
  )
137
156
  )
138
157
 
@@ -187,9 +206,13 @@ func validate_project(params: Dictionary) -> Dictionary:
187
206
  file.close()
188
207
 
189
208
  if "# TODO" in content or "# FIXME" in content:
190
- script_issues.append({"path": script_path, "issue": "Contains TODO/FIXME comments"})
209
+ script_issues.append(
210
+ { "path": script_path, "issue": "Contains TODO/FIXME comments" }
211
+ )
191
212
  if "pass # TODO" in content:
192
- script_issues.append({"path": script_path, "issue": "Contains unimplemented functions"})
213
+ script_issues.append(
214
+ { "path": script_path, "issue": "Contains unimplemented functions" }
215
+ )
193
216
 
194
217
  # Compiled by the server and handed in, as for the health check: a script the engine refuses
195
218
  # stops the export's game at the first scene using it, which the comment check above never saw.
@@ -224,13 +247,17 @@ func validate_project(params: Dictionary) -> Dictionary:
224
247
  # for never works, and the engine says so only while the game runs.
225
248
  checks_performed.append("input_actions")
226
249
  for entry: Dictionary in GdhInputActions.new(_log).undefined_in_scripts():
227
- issues.append(
228
- _finding(
229
- "error",
230
- "input_actions",
231
- GdhInputActions.undefined_line(entry),
232
- "Add it with project_settings add_input_action, or correct the name the script reads",
233
- include_suggestions
250
+ (
251
+ issues
252
+ . append(
253
+ _finding(
254
+ "error",
255
+ "input_actions",
256
+ GdhInputActions.undefined_line(entry),
257
+ "Add it with project_settings add_input_action, or correct the name the script "
258
+ + "reads",
259
+ include_suggestions
260
+ )
234
261
  )
235
262
  )
236
263
 
@@ -268,14 +295,14 @@ func validate_project(params: Dictionary) -> Dictionary:
268
295
  # Said beside the count, so a project of four hundred scripts is not read as checked whole.
269
296
  "scripts_total": script_files.size(),
270
297
  "issue_count": issues.size(),
271
- "warning_count": warnings.size()
298
+ "warning_count": warnings.size(),
272
299
  }
273
300
 
274
301
 
275
302
  func _finding(
276
303
  type: String, check: String, message: String, suggestion: String, include_suggestion: bool
277
304
  ) -> Dictionary:
278
- var finding: Dictionary = {"type": type, "check": check, "message": message}
305
+ var finding: Dictionary = { "type": type, "check": check, "message": message }
279
306
  if include_suggestion:
280
307
  finding["suggestion"] = suggestion
281
308
  return finding
@@ -1,11 +1,9 @@
1
1
  @tool
2
2
  extends RefCounted
3
-
4
3
  ## Where a property a tool writes lives: on the object given, on a resource built into it, or on an
5
4
  ## element of one of its lists that the write has to make first.
6
5
 
7
6
  const GdhRead = preload("reading.gd")
8
-
9
7
  const HEADINGS: int = PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP
10
8
 
11
9
 
@@ -95,11 +93,17 @@ static func _unlisted_in(items: Array, called: String, name: String, at: int) ->
95
93
  var end: int = name.find("/", at + 1)
96
94
  var index: String = name.substr(at + 1) if end < 0 else name.substr(at + 1, end - at - 1)
97
95
  if items.is_empty():
98
- return "%s holds no elements, so %s names none: give %s a whole list first." % [called, name, head]
96
+ return (
97
+ "%s holds no elements, so %s names none: give %s a whole list first."
98
+ % [called, name, head]
99
+ )
99
100
  var last: int = items.size() - 1
100
101
  if not index.is_valid_int():
101
102
  return (
102
- "%s is a list, so the step after it is the index of one of its elements, from 0 to %d, not %s."
103
+ (
104
+ "%s is a list, so the step after it is the index of one of its elements, from 0 to "
105
+ + "%d, not %s."
106
+ )
103
107
  % [called, last, index]
104
108
  )
105
109
  var place: int = index.to_int()
@@ -116,8 +120,8 @@ static func _unlisted_in(items: Array, called: String, name: String, at: int) ->
116
120
  if end < 0:
117
121
  return (
118
122
  (
119
- "%s/%d is an element of %s, which a path does not replace alone: give %s a whole list, or "
120
- + "write a property of the element, as %s/%d/<property>."
123
+ "%s/%d is an element of %s, which a path does not replace alone: give %s a whole "
124
+ + "list, or write a property of the element, as %s/%d/<property>."
121
125
  )
122
126
  % [head, place, called, head, head, place]
123
127
  )
@@ -197,12 +201,15 @@ static func grow(target: Object, name: String, called: String) -> String:
197
201
  above if not above.is_empty() else called,
198
202
  count,
199
203
  element.replace("_", " "),
200
- "" if count == 1 else "s"
204
+ "" if count == 1 else "s",
201
205
  ]
202
206
  )
203
207
  if index > count:
204
208
  return (
205
- "%s, and a new one goes after the last, so %s%d cannot be written yet: write %s%d first."
209
+ (
210
+ "%s, and a new one goes after the last, so %s%d cannot be written yet: write "
211
+ + "%s%d first."
212
+ )
206
213
  % [held, prefix, index, prefix, count]
207
214
  )
208
215
  if not adding.is_valid():
@@ -263,7 +270,10 @@ static func held_elsewhere(target: Object, name: String, home: String) -> String
263
270
  var file: String = "" if held == null else held.resource_path.get_slice("::", 0)
264
271
  if held != null and not held.is_built_in():
265
272
  return (
266
- "%s.%s is %s, a file of its own, so %s is written there, with resource_edit modify on %s."
273
+ (
274
+ "%s.%s is %s, a file of its own, so %s is written there, with resource_edit "
275
+ + "modify on %s."
276
+ )
267
277
  % [class_called(target), head, file, rest, file]
268
278
  )
269
279
  if held != null and not file.is_empty() and not home.is_empty() and file != home:
@@ -287,9 +297,9 @@ static func _built_in_elsewhere(
287
297
  node = " on %s" % from.get_path_to(placed)
288
298
  var text: String = (
289
299
  (
290
- "%s.%s is built into %s, so %s is written there, with scene_node set%s in %s, which changes "
291
- + "it wherever that scene is used. To change it here alone, give %s a %s of its own: a "
292
- + 'value with "_type" set to its class and its properties beside it.'
300
+ "%s.%s is built into %s, so %s is written there, with scene_node set%s in %s, which "
301
+ + "changes it wherever that scene is used. To change it here alone, give %s a %s of "
302
+ + 'its own: a value with "_type" set to its class and its properties beside it.'
293
303
  )
294
304
  % [class_called(target), head, file, rest, node, file, head, held.get_class()]
295
305
  )