diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/dist/linux/org.godotengine.Godot.xml | 2 | ||||
-rw-r--r-- | misc/dist/macos_template.app/Contents/Info.plist | 18 | ||||
-rw-r--r-- | misc/dist/shell/_godot.zsh-completion | 4 | ||||
-rw-r--r-- | misc/dist/shell/godot.bash-completion | 4 | ||||
-rw-r--r-- | misc/dist/shell/godot.fish | 4 | ||||
-rw-r--r-- | misc/extension_api_validation/4.0-stable.expected | 317 | ||||
-rwxr-xr-x | misc/hooks/pre-commit-make-rst | 2 | ||||
-rwxr-xr-x | misc/scripts/black_format.sh | 11 | ||||
-rwxr-xr-x | misc/scripts/clang_format.sh | 31 | ||||
-rwxr-xr-x | misc/scripts/clang_tidy.sh | 10 | ||||
-rwxr-xr-x | misc/scripts/codespell.sh | 2 | ||||
-rwxr-xr-x | misc/scripts/dotnet_format.sh | 10 | ||||
-rwxr-xr-x | misc/scripts/file_format.sh | 27 | ||||
-rwxr-xr-x | misc/scripts/header_guards.sh | 29 | ||||
-rwxr-xr-x | misc/scripts/validate_extension_api.sh | 60 |
15 files changed, 476 insertions, 55 deletions
diff --git a/misc/dist/linux/org.godotengine.Godot.xml b/misc/dist/linux/org.godotengine.Godot.xml index 2f06bb3639..d4452018c4 100644 --- a/misc/dist/linux/org.godotengine.Godot.xml +++ b/misc/dist/linux/org.godotengine.Godot.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<mime-info xmlns="https://specifications.freedesktop.org/shared-mime-info-spec"> +<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="application/x-godot-project"> <comment>Godot Engine project</comment> <sub-class-of type="text/plain"/> diff --git a/misc/dist/macos_template.app/Contents/Info.plist b/misc/dist/macos_template.app/Contents/Info.plist index 542146cdb8..40966d2ced 100644 --- a/misc/dist/macos_template.app/Contents/Info.plist +++ b/misc/dist/macos_template.app/Contents/Info.plist @@ -24,6 +24,20 @@ <string>$signature</string> <key>CFBundleVersion</key> <string>$version</string> + <key>DTPlatformBuild</key> + <string>$platfbuild</string> + <key>DTPlatformName</key> + <string>macosx</string> + <key>DTPlatformVersion</key> + <string>$sdkver</string> + <key>DTSDKBuild</key> + <string>$sdkbuild</string> + <key>DTSDKName</key> + <string>$sdkname</string> + <key>DTXcode</key> + <string>$xcodever</string> + <key>DTXcodeBuild</key> + <string>$xcodebuild</string> $usage_descriptions <key>NSHumanReadableCopyright</key> <string>$copyright</string> @@ -36,11 +50,11 @@ $usage_descriptions <key>LSApplicationCategoryType</key> <string>public.app-category.$app_category</string> <key>LSMinimumSystemVersion</key> - <string>10.12</string> + <string>$min_version</string> <key>LSMinimumSystemVersionByArchitecture</key> <dict> <key>x86_64</key> - <string>10.12</string> + <string>$min_version</string> </dict> <key>NSHighResolutionCapable</key> $highres diff --git a/misc/dist/shell/_godot.zsh-completion b/misc/dist/shell/_godot.zsh-completion index 61291899f3..89fe840166 100644 --- a/misc/dist/shell/_godot.zsh-completion +++ b/misc/dist/shell/_godot.zsh-completion @@ -88,6 +88,6 @@ _arguments \ '--build-solutions[build the scripting solutions (e.g. for C# projects)]' \ '--dump-gdextension-interface[generate GDExtension header file 'gdextension_interface.h' in the current folder. This file is the base file required to implement a GDExtension.]' \ '--dump-extension-api[generate JSON dump of the Godot API for GDExtension bindings named "extension_api.json" in the current folder]' \ - '--startup-benchmark[benchmark the startup time and print it to console]' \ - '--startup-benchmark-file[benchmark the startup time and save it to a given file in JSON format]:path to output JSON file' \ + '--benchmark[benchmark the run time and print it to console]' \ + '--benchmark-file[benchmark the run time and save it to a given file in JSON format]:path to output JSON file' \ '--test[run all unit tests; run with "--test --help" for more information]' diff --git a/misc/dist/shell/godot.bash-completion b/misc/dist/shell/godot.bash-completion index 79000da85d..a7ce11e524 100644 --- a/misc/dist/shell/godot.bash-completion +++ b/misc/dist/shell/godot.bash-completion @@ -91,8 +91,8 @@ _complete_godot_options() { --build-solutions --dump-gdextension-interface --dump-extension-api ---startup-benchmark ---startup-benchmark-file +--benchmark +--benchmark-file --test " -- "$1")) } diff --git a/misc/dist/shell/godot.fish b/misc/dist/shell/godot.fish index 8f521ec1a0..ed58d8dcf6 100644 --- a/misc/dist/shell/godot.fish +++ b/misc/dist/shell/godot.fish @@ -109,6 +109,6 @@ complete -c godot -l no-docbase -d "Disallow dumping the base types (used with - complete -c godot -l build-solutions -d "Build the scripting solutions (e.g. for C# projects)" complete -c godot -l dump-gdextension-interface -d "Generate GDExtension header file 'gdextension_interface.h' in the current folder. This file is the base file required to implement a GDExtension" complete -c godot -l dump-extension-api -d "Generate JSON dump of the Godot API for GDExtension bindings named 'extension_api.json' in the current folder" -complete -c godot -l startup-benchmark -d "Benchmark the startup time and print it to console" -complete -c godot -l startup-benchmark-file -d "Benchmark the startup time and save it to a given file in JSON format" -x +complete -c godot -l benchmark -d "Benchmark the run time and print it to console" +complete -c godot -l benchmark-file -d "Benchmark the run time and save it to a given file in JSON format" -x complete -c godot -l test -d "Run all unit tests; run with '--test --help' for more information" -x diff --git a/misc/extension_api_validation/4.0-stable.expected b/misc/extension_api_validation/4.0-stable.expected new file mode 100644 index 0000000000..2dad9359d4 --- /dev/null +++ b/misc/extension_api_validation/4.0-stable.expected @@ -0,0 +1,317 @@ +This file contains the expected output of --validate-extension-api when run against the extension_api.json of the +4.0-stable tag (the basename of this file). + +Only lines that start with "Validate extension JSON:" matter, everything else is considered a comment and ignored. They +should instead be used to justify these changes and describe how users should work around these changes. + +======================================================================================================================== + +GH-77757 +-------- +Validate extension JSON: Error: Field 'classes/Viewport/methods/gui_get_focus_owner': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Hash changed for 'classes/Viewport/methods/gui_get_focus_owner', from 31757941 to A5E188F5. This means that the function has changed and no compatibility function was provided. + +This method does not affect the state of Viewport so it should be const. + + +GH-74736 +-------- +Validate extension JSON: Error: Field 'classes/MenuBar/properties/start_index': type changed value in new API, from "bool" to "int". + +The previous type was simply wrong and the getter and setter already used int. + + +GH-74671 +-------- +Validate extension JSON: Error: Field 'native_structures/PhysicsServer3DExtensionMotionCollision': format changed value in new API, from "Vector3 position;Vector3 normal;Vector3 collider_velocity;real_t depth;int local_shape;ObjectID collider_id;RID collider;int collider_shape" to "Vector3 position;Vector3 normal;Vector3 collider_velocity;Vector3 collider_angular_velocity;real_t depth;int local_shape;ObjectID collider_id;RID collider;int collider_shape". +Validate extension JSON: Error: Field 'native_structures/PhysicsServer3DExtensionMotionResult': format changed value in new API, from "Vector3 travel;Vector3 remainder;real_t collision_safe_fraction;real_t collision_unsafe_fraction;PhysicsServer3DExtensionMotionCollision collisions[32];int collision_count" to "Vector3 travel;Vector3 remainder;real_t collision_depth;real_t collision_safe_fraction;real_t collision_unsafe_fraction;PhysicsServer3DExtensionMotionCollision collisions[32];int collision_count". + +The previous type was simply wrong and didn't match the actual C++ definition. Code targeting previous versions should use the updated definition as well. + + +GH-74600 +-------- +Validate extension JSON: Error: Hash changed for 'classes/AnimatedSprite2D/methods/play', from 57037631 to 8D62DD1B. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/AnimatedSprite3D/methods/play', from 57037631 to 8D62DD1B. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Animation/methods/compress', from 6B87C27F to D713F035. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/AnimationPlayer/methods/play', from 846788DD to B9DCE17F. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/AudioStreamPlayer/methods/play', from B54BA998 to 74B7272C. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/AudioStreamPlayer2D/methods/play', from B54BA998 to 74B7272C. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/AudioStreamPlayer3D/methods/play', from B54BA998 to 74B7272C. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/CanvasItem/methods/draw_set_transform', from F93CB735 to C3BC1B8B. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Curve2D/methods/sample_baked', from DF8CB3E7 to CE7C60AA. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Curve2D/methods/sample_baked_with_rotation', from 0F34F230 to C475D415. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Curve2D/methods/tessellate_even_length', from FC150C61 to 8A44C0E5. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Curve3D/methods/sample_baked', from FCBE3242 to 5078AD06. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Curve3D/methods/sample_baked_with_rotation', from 9431C26F to 7398459B. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Curve3D/methods/tessellate_even_length', from E96241BB to 07F10939. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/DisplayServer/methods/tts_speak', from DDE9B9D7 to DEFE6FA5. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Font/methods/find_variation', from DCDAC3C2 to 44828B18. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/GridMap/methods/make_baked_meshes', from 43AF36C6 to D72155A9. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Image/methods/bump_map_to_normal_map', from 1412C0CC to CC0E637C. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Image/methods/save_jpg_to_buffer', from 1285A12B to 234CCB09. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Image/methods/save_webp_to_buffer', from 49A857C1 to 4865C18E. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/PhysicsBody2D/methods/move_and_collide', from BE9F4C70 to 5B315D1A. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/PhysicsBody3D/methods/move_and_collide', from 44022073 to A86CD3DE. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/PhysicsBody3D/methods/test_move', from 7C246CBB to 288C8CC1. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/RandomNumberGenerator/methods/randfn', from 839678C5 to 31E8912C. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/RenderingServer/methods/canvas_item_set_canvas_group_mode', from 5D7655F8 to 0280768A. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/RenderingServer/methods/environment_set_ambient_light', from 159C6D6E to 1D4E1F3F. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/RenderingServer/methods/force_draw', from 359658A7 to 40254980. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Window/methods/popup_centered_clamped', from DE3D691D to 9BCAB29D. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Window/methods/popup_centered_ratio', from 71F7FFC1 to 3C7CD915. This means that the function has changed and no compatibility function was provided. + +None of these methods were actually changed, the hash changes only affects GDExtensions, no compatibility workaround exists currently. + + +GH-76413 +-------- +Validate extension JSON: API was removed: classes/AnimationTrackEditPlugin + +This class does nothing and is not useful in any way. + + +GH-69988 +-------- +Validate extension JSON: API was removed: classes/NavigationAgent2D/methods/get_time_horizon +Validate extension JSON: API was removed: classes/NavigationAgent2D/methods/set_time_horizon +Validate extension JSON: API was removed: classes/NavigationAgent2D/properties/time_horizon +Validate extension JSON: API was removed: classes/NavigationAgent3D/methods/get_agent_height_offset +Validate extension JSON: API was removed: classes/NavigationAgent3D/methods/get_ignore_y +Validate extension JSON: API was removed: classes/NavigationAgent3D/methods/get_time_horizon +Validate extension JSON: API was removed: classes/NavigationAgent3D/methods/set_agent_height_offset +Validate extension JSON: API was removed: classes/NavigationAgent3D/methods/set_ignore_y +Validate extension JSON: API was removed: classes/NavigationAgent3D/methods/set_time_horizon +Validate extension JSON: API was removed: classes/NavigationAgent3D/properties/agent_height_offset +Validate extension JSON: API was removed: classes/NavigationAgent3D/properties/ignore_y +Validate extension JSON: API was removed: classes/NavigationAgent3D/properties/time_horizon +Validate extension JSON: API was removed: classes/NavigationObstacle2D/methods/get_rid +Validate extension JSON: API was removed: classes/NavigationObstacle2D/methods/is_radius_estimated +Validate extension JSON: API was removed: classes/NavigationObstacle2D/methods/set_estimate_radius +Validate extension JSON: API was removed: classes/NavigationObstacle2D/properties/estimate_radius +Validate extension JSON: API was removed: classes/NavigationObstacle3D/methods/get_rid +Validate extension JSON: API was removed: classes/NavigationObstacle3D/methods/is_radius_estimated +Validate extension JSON: API was removed: classes/NavigationObstacle3D/methods/set_estimate_radius +Validate extension JSON: API was removed: classes/NavigationObstacle3D/properties/estimate_radius +Validate extension JSON: API was removed: classes/NavigationServer2D/methods/agent_set_callback +Validate extension JSON: API was removed: classes/NavigationServer2D/methods/agent_set_target_velocity +Validate extension JSON: API was removed: classes/NavigationServer2D/methods/agent_set_time_horizon +Validate extension JSON: API was removed: classes/NavigationServer3D/methods/agent_set_callback +Validate extension JSON: API was removed: classes/NavigationServer3D/methods/agent_set_target_velocity +Validate extension JSON: API was removed: classes/NavigationServer3D/methods/agent_set_time_horizon + +Navigation avoidance was reworked entirely. +Migration: TODO + + +GH-????? +-------- +Validate extension JSON: API was removed: classes/FramebufferCacheRD +Validate extension JSON: API was removed: classes/UniformSetCacheRD + +Unsure where these come from; when dumping the interface, these do actually still exist + +GH-76176 +-------- +Validate extension JSON: Error: Hash changed for 'classes/EditorInterface/methods/get_base_control', from 31757941 to A5E188F5. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/EditorInterface/methods/get_edited_scene_root', from 6C6B0707 to BC5DCFF4. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/EditorInterface/methods/get_editor_main_screen', from 36955D8D to 65B2D3B5. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/EditorInterface/methods/get_editor_paths', from FA334A57 to 5F1D5DC4. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/EditorInterface/methods/get_editor_settings', from 932B4D2E to F399A3EB. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/EditorInterface/methods/get_file_system_dock', from 217210BD to DF93E7E7. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/EditorInterface/methods/get_resource_filesystem', from 1D5C1A47 to 2E802B7E. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/EditorInterface/methods/get_resource_previewer', from 5E161783 to 383C77ED. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/EditorInterface/methods/get_script_editor', from EB48A7D4 to 056A8923. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/EditorInterface/methods/get_selection', from 0302AF0B to A05A4D13. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Field 'classes/EditorInterface/methods/get_base_control': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/EditorInterface/methods/get_edited_scene_root': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/EditorInterface/methods/get_editor_main_screen': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/EditorInterface/methods/get_editor_paths': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/EditorInterface/methods/get_editor_settings': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/EditorInterface/methods/get_file_system_dock': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/EditorInterface/methods/get_resource_filesystem': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/EditorInterface/methods/get_resource_previewer': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/EditorInterface/methods/get_script_editor': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/EditorInterface/methods/get_selection': is_const changed value in new API, from false to true. + +Functions were made `const`. No adjustments should be necessary. + + +GH-76026 +-------- +Validate extension JSON: Error: Hash changed for 'classes/EditorScript/methods/get_editor_interface', from FBC1084A to 75D179CC. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/EditorScript/methods/get_scene', from 6C6B0707 to BC5DCFF4. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Field 'classes/EditorScript/methods/get_editor_interface': is_const changed value in new API, from false to true. +Validate extension JSON: Error: Field 'classes/EditorScript/methods/get_scene': is_const changed value in new API, from false to true. + +Functions were made `const`. No adjustments should be necessary. + + +GH-76418 +-------- +Validate extension JSON: Error: Hash changed for 'classes/AnimationNodeStateMachinePlayback/methods/get_travel_path', from 43F252E9 to EE2D1D98. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Object/methods/get_meta_list', from 43F252E9 to EE2D1D98. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/RDShaderFile/methods/get_version_list', from 43F252E9 to EE2D1D98. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/RenderingServer/methods/global_shader_parameter_get_list', from 43F252E9 to EE2D1D98. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Field 'classes/AnimationNodeStateMachinePlayback/methods/get_travel_path/return_value': type changed value in new API, from "PackedStringArray" to "typedarray::StringName". +Validate extension JSON: Error: Field 'classes/Object/methods/get_meta_list/return_value': type changed value in new API, from "PackedStringArray" to "typedarray::StringName". +Validate extension JSON: Error: Field 'classes/RDShaderFile/methods/get_version_list/return_value': type changed value in new API, from "PackedStringArray" to "typedarray::StringName". +Validate extension JSON: Error: Field 'classes/RenderingServer/methods/global_shader_parameter_get_list/return_value': type changed value in new API, from "PackedStringArray" to "typedarray::StringName". + +Validate extension JSON: Error: Field 'classes/Geometry3D/methods/segment_intersects_convex/arguments/2': type changed value in new API, from "Array" to "typedarray::Plane". +Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/draw_list_begin/arguments/9': type changed value in new API, from "Array" to "typedarray::RID". +Validate extension JSON: Error: Field 'classes/SurfaceTool/methods/add_triangle_fan/arguments/5': default_value changed value in new API, from "[]" to "Array[Plane]([])". +Validate extension JSON: Error: Field 'classes/SurfaceTool/methods/add_triangle_fan/arguments/5': type changed value in new API, from "Array" to "typedarray::Plane". + +Return types change, fixed some internal type issues and unnecessarily changed the public type in the process. + + +GH-72749 +-------- +Validate extension JSON: Error: Hash changed for 'classes/Area2D/methods/get_priority', from 67C0E66E to E8C5525A. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Area2D/methods/set_priority', from 1647D661 to 4CAD1009. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Area3D/methods/get_priority', from 67C0E66E to E8C5525A. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Area3D/methods/set_priority', from 1647D661 to 4CAD1009. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Field 'classes/Area2D/methods/get_priority/return_value': meta changed value in new API, from "float" to "int32". +Validate extension JSON: Error: Field 'classes/Area2D/methods/get_priority/return_value': type changed value in new API, from "float" to "int". +Validate extension JSON: Error: Field 'classes/Area2D/methods/set_priority/arguments/0': meta changed value in new API, from "float" to "int32". +Validate extension JSON: Error: Field 'classes/Area2D/methods/set_priority/arguments/0': type changed value in new API, from "float" to "int". +Validate extension JSON: Error: Field 'classes/Area3D/methods/get_priority/return_value': meta changed value in new API, from "float" to "int32". +Validate extension JSON: Error: Field 'classes/Area3D/methods/get_priority/return_value': type changed value in new API, from "float" to "int". +Validate extension JSON: Error: Field 'classes/Area3D/methods/set_priority/arguments/0': meta changed value in new API, from "float" to "int32". +Validate extension JSON: Error: Field 'classes/Area3D/methods/set_priority/arguments/0': type changed value in new API, from "float" to "int". + +Type changed from `float` to `int`. Previously the `float` values were internally converted to `int`s anyways and the type ways inconsistent with the type of the priority property, which already was `int`. + + +GH-72152 +-------- +Validate extension JSON: Error: Hash changed for 'classes/MeshInstance3D/methods/create_multiple_convex_collisions', from BFDD6D64 to 257A91A5. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: JSON file: Field was added in a way that breaks compatibility 'classes/MeshInstance3D/methods/create_multiple_convex_collisions': arguments + +Added an optional parameter with a default value. No adjustments should be necessary. + + +GH-75759 +-------- +Validate extension JSON: Error: Hash changed for 'classes/AnimationNode/methods/blend_input', from 5162412C to A178F700. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/AnimationNode/methods/blend_node', from 1263CBA5 to 0FB30106. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Field 'classes/AnimationNode/methods/_process/arguments': size changed value in new API, from 3 to 4. +Validate extension JSON: Error: Field 'classes/AnimationNode/methods/blend_input/arguments': size changed value in new API, from 7 to 8. +Validate extension JSON: Error: Field 'classes/AnimationNode/methods/blend_node/arguments': size changed value in new API, from 8 to 9. + +`_process`: Added a parameter to a virtual method. +`blend_input`, `blend_node`: Added an optional parameter with a default value. No adjustments should be necessary. + + +GH-75017 +-------- +Validate extension JSON: Error: Hash changed for 'classes/RichTextLabel/methods/push_list', from 8593DF77 to F0951C19. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Field 'classes/RichTextLabel/methods/push_list/arguments': size changed value in new API, from 3 to 4. + +Added an optional parameter with a default value. No adjustments should be necessary. + + +GH-76794 +-------- +Validate extension JSON: Error: Hash changed for 'classes/Tree/methods/edit_selected', from 859196D4 to 9AB67ACD. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: JSON file: Field was added in a way that breaks compatibility 'classes/Tree/methods/edit_selected': arguments + +Added an optional parameter with a default value. No adjustments should be necessary. + + +GH-75777 +-------- +Validate extension JSON: Error: Hash changed for 'classes/SyntaxHighlighter/methods/get_text_edit', from 8248B40D to 70D54D11. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Field 'classes/SyntaxHighlighter/methods/get_text_edit': is_const changed value in new API, from false to true. + +Function was made `const`. No adjustments should be necessary. + + + +GH-75250 & GH-76401 +------------------- +Validate extension JSON: Error: Hash changed for 'classes/RichTextLabel/methods/push_paragraph', from 3DD1D1C2 to BFDC71FE. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Field 'classes/RichTextLabel/methods/push_paragraph/arguments': size changed value in new API, from 4 to 6. + +Added a optional parameters with default values. No adjustments should be necessary. + + +GH-77143 +-------- +Validate extension JSON: Error: Hash changed for 'classes/WorkerThreadPool/methods/wait_for_task_completion', from 4CAD1009 to 32573865. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: JSON file: Field was added in a way that breaks compatibility 'classes/WorkerThreadPool/methods/wait_for_task_completion': return_value + +Changed the return value from `void` to `Error`. No adjustments should be necessary. + + +GH-64628 +-------- +Validate extension JSON: Error: Field 'classes/EditorResourcePreviewGenerator/methods/_generate/arguments': size changed value in new API, from 2 to 3. +Validate extension JSON: Error: Field 'classes/EditorResourcePreviewGenerator/methods/_generate_from_path/arguments': size changed value in new API, from 2 to 3. + +Added parameters to virtual method. + + +GH-76406 +-------- +Validate extension JSON: Error: Field 'classes/GDExtension/methods/open_library/arguments': size changed value in new API, from 2 to 3. + +Added an optional parameter with a default value. No adjustments should be necessary. + + +GH-74242 +-------- +Validate extension JSON: Error: Field 'classes/PhysicsDirectSpaceState3DExtension/methods/_intersect_ray/arguments': size changed value in new API, from 8 to 9. +Validate extension JSON: Error: Field 'classes/PhysicsDirectSpaceState3DExtension/methods/_intersect_ray/arguments/7': type changed value in new API, from "PhysicsServer3DExtensionRayResult*" to "bool". + +Added new second-to-last parameter to virtual method. + + +GH-74707 +-------- +Validate extension JSON: Error: Field 'classes/PhysicsServer3DExtension/methods/_body_test_motion/arguments': size changed value in new API, from 7 to 8. +Validate extension JSON: Error: Field 'classes/PhysicsServer3DExtension/methods/_body_test_motion/arguments/6': type changed value in new API, from "PhysicsServer3DExtensionMotionResult*" to "bool". + +Added new second-to-last parameter to virtual method. + + +GH-72842 +-------- +Validate extension JSON: API was removed: classes/PathFollow2D/methods/get_lookahead +Validate extension JSON: API was removed: classes/PathFollow2D/methods/set_lookahead +Validate extension JSON: API was removed: classes/PathFollow2D/properties/lookahead + + +GH-77413 +-------- +Validate extension JSON: Error: Field 'classes/GLTFSkin/properties/godot_skin': type changed value in new API, from "Object" to "Skin". + + +GH-76082 +-------- +Validate extension JSON: Error: Hash changed for 'builtin_classes/Basis/methods/looking_at', from 19076B74 to DE3FF159. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'builtin_classes/Transform3D/methods/looking_at', from 3018C31C to 056ADC36. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Node3D/methods/look_at', from 3BC64EA6 to BA2B4FA9. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Hash changed for 'classes/Node3D/methods/look_at_from_position', from 2BD0F953 to F2739FA7. This means that the function has changed and no compatibility function was provided. +Validate extension JSON: Error: Field 'builtin_classes/Basis/methods/looking_at/arguments': size changed value in new API, from 2 to 3. +Validate extension JSON: Error: Field 'builtin_classes/Transform3D/methods/looking_at/arguments': size changed value in new API, from 2 to 3. +Validate extension JSON: Error: Field 'classes/Node3D/methods/look_at/arguments': size changed value in new API, from 2 to 3. +Validate extension JSON: Error: Field 'classes/Node3D/methods/look_at_from_position/arguments': size changed value in new API, from 3 to 4. + +Added an optional parameter with a default value. No adjustments should be necessary. + + +GH-77411 +-------- +Validate extension JSON: Error: Field 'classes/Control/methods/_get_drag_data': is_const changed value in new API, from true to false. + +`const` was removed from virtual method, it may be necessary to adjust the constness of implementing methods. + + +GH-75260 +-------- +Validate extension JSON: Error: Field 'classes/PhysicsDirectSpaceState2D/methods/collide_shape/return_value': type changed value in new API, from "typedarray::PackedVector2Array" to "typedarray::Vector2". +Validate extension JSON: Error: Field 'classes/PhysicsDirectSpaceState3D/methods/collide_shape/return_value': type changed value in new API, from "typedarray::PackedVector3Array" to "typedarray::Vector3". + +The previous type declaration was simply wrong and the method did actually already return objects of the new type. diff --git a/misc/hooks/pre-commit-make-rst b/misc/hooks/pre-commit-make-rst index 7d115f1d13..3737272a6d 100755 --- a/misc/hooks/pre-commit-make-rst +++ b/misc/hooks/pre-commit-make-rst @@ -9,4 +9,4 @@ if [[ "$py_ver" != "3" ]]; then PYTHON+=3 fi -$PYTHON doc/tools/make_rst.py doc/classes modules --dry-run --color +$PYTHON doc/tools/make_rst.py doc/classes modules platform --dry-run --color diff --git a/misc/scripts/black_format.sh b/misc/scripts/black_format.sh index f6fac58e50..3a64284eb6 100755 --- a/misc/scripts/black_format.sh +++ b/misc/scripts/black_format.sh @@ -13,13 +13,14 @@ diff=$(git diff --color) # If no diff has been generated all is OK, clean up, and exit. if [ -z "$diff" ] ; then - printf "Files in this commit comply with the black style rules.\n" + printf "\e[1;32m*** Files in this commit comply with the black style rules.\e[0m\n" exit 0 fi # A diff has been created, notify the user, clean up, and exit. -printf "\n*** The following differences were found between the code " -printf "and the formatting rules:\n\n" -echo "$diff" -printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n" +printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n" +# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`. +printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge' + +printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n" exit 1 diff --git a/misc/scripts/clang_format.sh b/misc/scripts/clang_format.sh index edecdb6ecb..74a8e1a8a3 100755 --- a/misc/scripts/clang_format.sh +++ b/misc/scripts/clang_format.sh @@ -5,15 +5,22 @@ set -uo pipefail -# Loops through all code files tracked by Git. -git ls-files -- '*.c' '*.h' '*.cpp' '*.hpp' '*.cc' '*.hh' '*.cxx' '*.m' '*.mm' '*.inc' '*.java' '*.glsl' \ +if [ $# -eq 0 ]; then + # Loop through all code files tracked by Git. + files=$(git ls-files -- '*.c' '*.h' '*.cpp' '*.hpp' '*.cc' '*.hh' '*.cxx' '*.m' '*.mm' '*.inc' '*.java' '*.glsl' \ ':!:.git/*' ':!:thirdparty/*' ':!:*/thirdparty/*' ':!:platform/android/java/lib/src/com/google/*' \ - ':!:*-so_wrap.*' ':!:tests/python_build/*' | -while read -r f; do - # Run clang-format. - clang-format --Wno-error=unknown -i "$f" + ':!:*-so_wrap.*' ':!:tests/python_build/*') +else + # $1 should be a file listing file paths to process. Used in CI. + files=$(cat "$1" | grep -v "thirdparty/" | grep -E "\.(c|h|cpp|hpp|cc|hh|cxx|m|mm|inc|java|glsl)$" | grep -v "platform/android/java/lib/src/com/google/" | grep -v "\-so_wrap\." | grep -v "tests/python_build/") +fi + +if [ ! -z "$files" ]; then + clang-format --Wno-error=unknown -i $files +fi - # Fix copyright headers, but not all files get them. +# Fix copyright headers, but not all files get them. +for f in $files; do if [[ "$f" == *"inc" ]]; then continue elif [[ "$f" == *"glsl" ]]; then @@ -33,12 +40,14 @@ diff=$(git diff --color) # If no diff has been generated all is OK, clean up, and exit. if [ -z "$diff" ] ; then - printf "Files in this commit comply with the clang-format style rules.\n" + printf "\e[1;32m*** Files in this commit comply with the clang-format style rules.\e[0m\n" exit 0 fi # A diff has been created, notify the user, clean up, and exit. -printf "\n*** The following changes have been made to comply with the formatting rules:\n\n" -echo "$diff" -printf "\n*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n" +printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n" +# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`. +printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge' + +printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n" exit 1 diff --git a/misc/scripts/clang_tidy.sh b/misc/scripts/clang_tidy.sh index 63c1b10042..c4811b903c 100755 --- a/misc/scripts/clang_tidy.sh +++ b/misc/scripts/clang_tidy.sh @@ -20,12 +20,14 @@ diff=$(git diff --color) # If no diff has been generated all is OK, clean up, and exit. if [ -z "$diff" ] ; then - printf "Files in this commit comply with the clang-tidy style rules.\n" + printf "\e[1;32m*** Files in this commit comply with the clang-tidy style rules.\e[0m\n" exit 0 fi # A diff has been created, notify the user, clean up, and exit. -printf "\n*** The following changes have been made to comply with the formatting rules:\n\n" -echo "$diff" -printf "\n*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n" +printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n" +# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`. +printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge' + +printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n" exit 1 diff --git a/misc/scripts/codespell.sh b/misc/scripts/codespell.sh index 775d193a66..d15b6593f7 100755 --- a/misc/scripts/codespell.sh +++ b/misc/scripts/codespell.sh @@ -3,6 +3,6 @@ SKIP_LIST="./.*,./**/.*,./bin,./thirdparty,*.desktop,*.gen.*,*.po,*.pot,*.rc,./A SKIP_LIST+="./core/input/gamecontrollerdb.txt,./core/string/locales.h,./editor/renames_map_3_to_4.cpp,./misc/scripts/codespell.sh," SKIP_LIST+="./platform/android/java/lib/src/com,./platform/web/node_modules,./platform/web/package-lock.json," -IGNORE_LIST="curvelinear,doubleclick,expct,findn,gird,hel,inout,lod,nd,numer,ot,te" +IGNORE_LIST="curvelinear,doubleclick,expct,findn,gird,hel,inout,lod,nd,numer,ot,te,vai" codespell -w -q 3 -S "${SKIP_LIST}" -L "${IGNORE_LIST}" --builtin "clear,rare,en-GB_to_en-US" diff --git a/misc/scripts/dotnet_format.sh b/misc/scripts/dotnet_format.sh index cc34137a37..cac00f5cb1 100755 --- a/misc/scripts/dotnet_format.sh +++ b/misc/scripts/dotnet_format.sh @@ -24,12 +24,14 @@ diff=$(git diff --color) # If no diff has been generated all is OK, clean up, and exit. if [ -z "$diff" ] ; then - printf "Files in this commit comply with the dotnet format style rules.\n" + printf "\e[1;32m*** Files in this commit comply with the dotnet format style rules.\e[0m\n" exit 0 fi # A diff has been created, notify the user, clean up, and exit. -printf "\n*** The following changes have been made to comply with the formatting rules:\n\n" -echo "$diff" -printf "\n*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n" +printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n" +# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`. +printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge' + +printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n" exit 1 diff --git a/misc/scripts/file_format.sh b/misc/scripts/file_format.sh index 3ff5798e22..94a3affbd7 100755 --- a/misc/scripts/file_format.sh +++ b/misc/scripts/file_format.sh @@ -7,14 +7,20 @@ # We need dos2unix and isutf8. if [ ! -x "$(command -v dos2unix)" -o ! -x "$(command -v isutf8)" ]; then printf "Install 'dos2unix' and 'isutf8' (moreutils package) to use this script.\n" + exit 1 fi set -uo pipefail -IFS=$'\n\t' -# Loops through all text files tracked by Git. -git grep -zIl '' | -while IFS= read -rd '' f; do +if [ $# -eq 0 ]; then + # Loop through all code files tracked by Git. + mapfile -d '' files < <(git grep -zIl '') +else + # $1 should be a file listing file paths to process. Used in CI. + mapfile -d ' ' < <(cat "$1") +fi + +for f in "${files[@]}"; do # Exclude some types of files. if [[ "$f" == *"csproj" ]]; then continue @@ -56,7 +62,7 @@ diff=$(git diff --color) if [ ! -s utf8-validation.txt ] && [ -z "$diff" ] ; then # If no UTF-8 violations were collected (the file is empty) and # no diff has been generated all is OK, clean up, and exit. - printf "Files in this commit comply with the formatting rules.\n" + printf "\e[1;32m*** Files in this commit comply with the file formatting rules.\e[0m\n" rm -f utf8-validation.txt exit 0 fi @@ -65,7 +71,7 @@ if [ -s utf8-validation.txt ] then # If the file has content and is not empty, violations # detected, notify the user, clean up, and exit. - printf "\n*** The following files contain invalid UTF-8 character sequences:\n\n" + printf "\n\e[1;33m*** The following files contain invalid UTF-8 character sequences:\e[0m\n\n" cat utf8-validation.txt fi @@ -73,10 +79,11 @@ rm -f utf8-validation.txt if [ ! -z "$diff" ] then - printf "\n*** The following differences were found between the code " - printf "and the formatting rules:\n\n" - echo "$diff" + # A diff has been created, notify the user, clean up, and exit. + printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n" + # Perl commands replace trailing spaces with `·` and tabs with `<TAB>`. + printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge' fi -printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n" +printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n" exit 1 diff --git a/misc/scripts/header_guards.sh b/misc/scripts/header_guards.sh index 9fdc864f8c..1f8aa6151c 100755 --- a/misc/scripts/header_guards.sh +++ b/misc/scripts/header_guards.sh @@ -5,9 +5,17 @@ if [ ! -f "version.py" ]; then echo "Some of the paths checks may not work as intended from a different folder." fi +if [ $# -eq 0 ]; then + # Loop through all code files tracked by Git. + files=$(find -name "thirdparty" -prune -o -name "*.h" -print | sed "s@^\./@@g") +else + # $1 should be a file listing file paths to process. Used in CI. + files=$(cat "$1" | grep -v "thirdparty/" | grep -E "\.h$" | sed "s@^\./@@g") +fi + files_invalid_guard="" -for file in $(find -name "thirdparty" -prune -o -name "*.h" -print); do +for file in $files; do # Skip *.gen.h and *-so_wrap.h, they're generated. if [[ "$file" == *".gen.h" || "$file" == *"-so_wrap.h" ]]; then continue; fi # Has important define before normal header guards. @@ -20,16 +28,16 @@ for file in $(find -name "thirdparty" -prune -o -name "*.h" -print); do # Add custom prefix or suffix for generic filenames with a well-defined namespace. prefix= - if [[ "$file" == "./modules/"*"/register_types.h" ]]; then + if [[ "$file" == "modules/"*"/register_types.h" ]]; then module=$(echo $file | sed "s@.*modules/\([^/]*\).*@\1@") prefix="${module^^}_" fi - if [[ "$file" == "./platform/"*"/api/api.h" || "$file" == "./platform/"*"/export/"* ]]; then + if [[ "$file" == "platform/"*"/api/api.h" || "$file" == "platform/"*"/export/"* ]]; then platform=$(echo $file | sed "s@.*platform/\([^/]*\).*@\1@") prefix="${platform^^}_" fi - if [[ "$file" == "./modules/mono/utils/"* && "$bname" != *"mono"* ]]; then prefix="MONO_"; fi - if [[ "$file" == "./servers/rendering/storage/utilities.h" ]]; then prefix="RENDERER_"; fi + if [[ "$file" == "modules/mono/utils/"* && "$bname" != *"mono"* ]]; then prefix="MONO_"; fi + if [[ "$file" == "servers/rendering/storage/utilities.h" ]]; then prefix="RENDERER_"; fi suffix= if [[ "$file" == *"dummy"* && "$bname" != *"dummy"* ]]; then suffix="_DUMMY"; fi @@ -66,13 +74,14 @@ diff=$(git diff --color) # If no diff has been generated all is OK, clean up, and exit. if [ -z "$diff" ] ; then - printf "Files in this commit comply with the header guards formatting rules.\n" + printf "\e[1;32m*** Files in this commit comply with the header guards formatting rules.\e[0m\n" exit 0 fi # A diff has been created, notify the user, clean up, and exit. -printf "\n*** The following differences were found between the code " -printf "and the header guards formatting rules:\n\n" -echo "$diff" -printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n" +printf "\n\e[1;33m*** The following changes must be made to comply with the formatting rules:\e[0m\n\n" +# Perl commands replace trailing spaces with `·` and tabs with `<TAB>`. +printf "$diff\n" | perl -pe 's/(.*[^ ])( +)(\e\[m)$/my $spaces="·" x length($2); sprintf("$1$spaces$3")/ge' | perl -pe 's/(.*[^\t])(\t+)(\e\[m)$/my $tabs="<TAB>" x length($2); sprintf("$1$tabs$3")/ge' + +printf "\n\e[1;91m*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\e[0m\n" exit 1 diff --git a/misc/scripts/validate_extension_api.sh b/misc/scripts/validate_extension_api.sh new file mode 100755 index 0000000000..6cc22c9b63 --- /dev/null +++ b/misc/scripts/validate_extension_api.sh @@ -0,0 +1,60 @@ +#!/bin/bash +set -uo pipefail + +if [ ! -f "version.py" ]; then + echo "Warning: This script is intended to be run from the root of the Godot repository." + echo "Some of the paths checks may not work as intended from a different folder." +fi + +if [ $# != 1 ]; then + echo "Usage: @0 <path-to-godot-executable>" +fi + +has_problems=0 + +make_annotation() +{ + local title=$1 + local body=$2 + local type=$3 + local file=$4 + if [ ! -v GITHUB_OUTPUT ]; then + echo "$title" + echo "$body" + else + body="$(awk 1 ORS='%0A' - <<<"$body")" + echo "::$type file=$file,title=$title ::$body" + fi +} + +while read -r file; do + reference_file="$(mktemp)" + validate="$(mktemp)" + validation_output="$(mktemp)" + allowed_errors="$(mktemp)" + + # Download the reference extension_api.json + reference_tag="$(basename -s .expected "$file")" + wget -qcO "$reference_file" "https://raw.githubusercontent.com/godotengine/godot-cpp/godot-$reference_tag/gdextension/extension_api.json" + # Validate the current API against the reference + "$1" --headless --validate-extension-api "$reference_file" 2>&1 | tee "$validate" | awk '!/^Validate extension JSON:/' - || true + # Collect the expected and actual validation errors + awk '/^Validate extension JSON:/' - < "$validate" | sort > "$validation_output" + awk '/^Validate extension JSON:/' - < "$file" | sort > "$allowed_errors" + + # Differences between the expected and actual errors + new_validation_error="$(comm "$validation_output" "$allowed_errors" -23)" + obsolete_validation_error="$(comm "$validation_output" "$allowed_errors" -13)" + + if [ -n "$obsolete_validation_error" ]; then + make_annotation "The following validation errors no longer occur (compared to $reference_tag):" "$obsolete_validation_error" warning "$file" + fi + if [ -n "$new_validation_error" ]; then + make_annotation "Compatibility to $reference_tag is broken in the following ways:" "$new_validation_error" error README.md + has_problems=1 + fi + + rm -f "$reference_file" "$validate" "$validation_output" "$allowed_errors" +done <<< "$(find "$( dirname -- "$( dirname -- "${BASH_SOURCE[0]//\.\//}" )" )/extension_api_validation/" -name "*.expected")" + +exit $has_problems |