Integrate .pre-commit-config.yaml

This commit is contained in:
Thaddeus Crews
2024-06-24 12:20:55 -05:00
parent c414c2b37d
commit e0d363aad8
45 changed files with 424 additions and 1013 deletions

View File

@@ -1,6 +1,4 @@
#!/usr/bin/env python
import os
import sys
env = SConscript("../SConstruct")

View File

@@ -96,8 +96,8 @@ func _ready():
assert_equal(example.test_str_utility(), "Hello, World! The answer is 42")
# Test converting string to char* and doing comparison.
assert_equal(example.test_string_is_fourty_two("blah"), false)
assert_equal(example.test_string_is_fourty_two("fourty two"), true)
assert_equal(example.test_string_is_forty_two("blah"), false)
assert_equal(example.test_string_is_forty_two("forty two"), true)
# String::resize().
assert_equal(example.test_string_resize("What"), "What!?")

View File

@@ -202,7 +202,7 @@ void Example::_bind_methods() {
ClassDB::bind_method(D_METHOD("test_node_argument"), &Example::test_node_argument);
ClassDB::bind_method(D_METHOD("test_string_ops"), &Example::test_string_ops);
ClassDB::bind_method(D_METHOD("test_str_utility"), &Example::test_str_utility);
ClassDB::bind_method(D_METHOD("test_string_is_fourty_two"), &Example::test_string_is_fourty_two);
ClassDB::bind_method(D_METHOD("test_string_is_forty_two"), &Example::test_string_is_forty_two);
ClassDB::bind_method(D_METHOD("test_string_resize"), &Example::test_string_resize);
ClassDB::bind_method(D_METHOD("test_vector_ops"), &Example::test_vector_ops);
ClassDB::bind_method(D_METHOD("test_vector_init_list"), &Example::test_vector_init_list);
@@ -299,7 +299,7 @@ bool Example::has_object_instance_binding() const {
Example::Example() :
object_instance_binding_set_by_parent_constructor(has_object_instance_binding()) {
// Test conversion, to ensure users can use all parent calss functions at this time.
// Test conversion, to ensure users can use all parent class functions at this time.
// It would crash if instance binding still not be initialized.
Variant v = Variant(this);
Object *o = (Object *)v;
@@ -361,7 +361,7 @@ ExampleRef *Example::return_extended_ref() const {
}
Ref<ExampleRef> Example::extended_ref_checks(Ref<ExampleRef> p_ref) const {
// This is therefor the prefered way of instancing and returning a refcounted object:
// This is therefore the preferred way of instancing and returning a refcounted object:
Ref<ExampleRef> ref;
ref.instantiate();
return ref;
@@ -410,8 +410,8 @@ String Example::test_str_utility() const {
return UtilityFunctions::str("Hello, ", "World", "! The answer is ", 42);
}
bool Example::test_string_is_fourty_two(const String &p_string) const {
return strcmp(p_string.utf8().ptr(), "fourty two") == 0;
bool Example::test_string_is_forty_two(const String &p_string) const {
return strcmp(p_string.utf8().ptr(), "forty two") == 0;
}
String Example::test_string_resize(String p_string) const {

View File

@@ -132,7 +132,7 @@ public:
Example *test_node_argument(Example *p_node) const;
String test_string_ops() const;
String test_str_utility() const;
bool test_string_is_fourty_two(const String &p_str) const;
bool test_string_is_forty_two(const String &p_str) const;
String test_string_resize(String p_original) const;
int test_vector_ops() const;
int test_vector_init_list() const;