mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add GDScript .editorconfig rules
- Uniformize `.gd` unit test files indentation to tabs (where needed)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const dictionary := {}
|
||||
|
||||
func test():
|
||||
dictionary.erase(0)
|
||||
dictionary.erase(0)
|
||||
|
||||
@@ -9,7 +9,7 @@ func test():
|
||||
array_sname.push_back(&"godot")
|
||||
print("String in Array: ", "godot" in array_sname)
|
||||
|
||||
# Not equal because the values are different types.
|
||||
# Not equal because the values are different types.
|
||||
print("Arrays not equal: ", array_str != array_sname)
|
||||
|
||||
var string_array: Array[String] = []
|
||||
|
||||
@@ -13,5 +13,5 @@ func test():
|
||||
print("String gets StringName: ", stringname_dict.get("abc"))
|
||||
|
||||
stringname_dict[&"abc"] = 42
|
||||
# They compare equal because StringName keys are converted to String.
|
||||
# They compare equal because StringName keys are converted to String.
|
||||
print("String Dictionary == StringName Dictionary: ", string_dict == stringname_dict)
|
||||
|
||||
@@ -3,23 +3,23 @@
|
||||
var a: int = 1
|
||||
|
||||
func shadow_regular_assignment(a: Variant, b: Variant) -> void:
|
||||
print(a)
|
||||
print(self.a)
|
||||
a = b
|
||||
print(a)
|
||||
print(self.a)
|
||||
print(a)
|
||||
print(self.a)
|
||||
a = b
|
||||
print(a)
|
||||
print(self.a)
|
||||
|
||||
|
||||
var v := Vector2(0.0, 0.0)
|
||||
|
||||
func shadow_subscript_assignment(v: Vector2, x: float) -> void:
|
||||
print(v)
|
||||
print(self.v)
|
||||
v.x += x
|
||||
print(v)
|
||||
print(self.v)
|
||||
print(v)
|
||||
print(self.v)
|
||||
v.x += x
|
||||
print(v)
|
||||
print(self.v)
|
||||
|
||||
|
||||
func test():
|
||||
shadow_regular_assignment('a', 'b')
|
||||
shadow_subscript_assignment(Vector2(1.0, 1.0), 5.0)
|
||||
shadow_regular_assignment('a', 'b')
|
||||
shadow_subscript_assignment(Vector2(1.0, 1.0), 5.0)
|
||||
|
||||
Reference in New Issue
Block a user