summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDanil Alexeev <danil@alexeev.xyz>2023-03-03 17:42:32 +0300
committerYuri Sizov <yuris@humnom.net>2023-03-13 14:42:27 +0100
commitf4ea9df0f4ddfc5b46419710e0d4ff02c8b0260f (patch)
tree68550a1846cc63980301e6d4889b49c9955d1c40 /modules
parentacdb1bdbd7aed6442e840074b3a5c09202be6660 (diff)
Fix GDScript code style regarding colon
(cherry picked from commit ea5fd3d732a85029e8372425904971ad26153ff1)
Diffstat (limited to 'modules')
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/enum_function_parameter_wrong_type.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/preload_enum_error.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/property_function_get_type_error.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/property_function_set_type_error.gd6
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/property_inline_get_type_error.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/property_inline_set_type_error.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/enum_duplicate_into_dict.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/enum_function_typecheck.gd16
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/enum_native_access_types.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/enum_typecheck_inner_class.gd16
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/property_inline.gd6
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd2
-rw-r--r--modules/gdscript/tests/scripts/parser/features/static_typing.gd2
-rw-r--r--modules/gdscript/tests/scripts/parser/features/static_typing.out10
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd4
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd2
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd2
21 files changed, 50 insertions, 48 deletions
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml
index 045505b720..effc0aab96 100644
--- a/modules/gdscript/doc_classes/@GDScript.xml
+++ b/modules/gdscript/doc_classes/@GDScript.xml
@@ -285,7 +285,7 @@
@export var string = ""
@export var int_number = 5
@export var float_number: float = 5
- @export var image : Image
+ @export var image: Image
[/codeblock]
</description>
</annotation>
@@ -309,7 +309,7 @@
Export a [Color] property without allowing its transparency ([member Color.a]) to be edited.
See also [constant PROPERTY_HINT_COLOR_NO_ALPHA].
[codeblock]
- @export_color_no_alpha var dye_color : Color
+ @export_color_no_alpha var dye_color: Color
[/codeblock]
</description>
</annotation>
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/enum_function_parameter_wrong_type.gd b/modules/gdscript/tests/scripts/analyzer/errors/enum_function_parameter_wrong_type.gd
index 62ac1c3108..900155569c 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/enum_function_parameter_wrong_type.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/enum_function_parameter_wrong_type.gd
@@ -1,7 +1,7 @@
enum MyEnum { ENUM_VALUE_1, ENUM_VALUE_2 }
enum MyOtherEnum { OTHER_ENUM_VALUE_1, OTHER_ENUM_VALUE_2 }
-func enum_func(e : MyEnum) -> void:
+func enum_func(e: MyEnum) -> void:
print(e)
func test():
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd b/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd
index dd2708b21d..63c080e583 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd
@@ -4,4 +4,4 @@ func test():
x.free()
var ok = x
- var bad : Node = x
+ var bad: Node = x
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/preload_enum_error.gd b/modules/gdscript/tests/scripts/analyzer/errors/preload_enum_error.gd
index 4e75ded96a..c84a4ad8af 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/preload_enum_error.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/preload_enum_error.gd
@@ -2,5 +2,5 @@ enum LocalNamed { VALUE_A, VALUE_B, VALUE_C = 42 }
func test():
const P = preload("../features/enum_from_outer.gd")
- var x : LocalNamed
+ var x: LocalNamed
x = P.Named.VALUE_A
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/property_function_get_type_error.gd b/modules/gdscript/tests/scripts/analyzer/errors/property_function_get_type_error.gd
index f1be6aaa0c..35f506aabd 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/property_function_get_type_error.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/property_function_get_type_error.gd
@@ -1,7 +1,7 @@
-var _prop : int
+var _prop: int
# Getter function has wrong return type.
-var prop : String:
+var prop: String:
get = get_prop
func get_prop():
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/property_function_set_type_error.gd b/modules/gdscript/tests/scripts/analyzer/errors/property_function_set_type_error.gd
index dd190157a1..eedeea915d 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/property_function_set_type_error.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/property_function_set_type_error.gd
@@ -1,10 +1,10 @@
-var _prop : int
+var _prop: int
# Setter function has wrong argument type.
-var prop : String:
+var prop: String:
set = set_prop
-func set_prop(value : int):
+func set_prop(value: int):
_prop = value
func test():
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/property_inline_get_type_error.gd b/modules/gdscript/tests/scripts/analyzer/errors/property_inline_get_type_error.gd
index 7f2b29222a..90b00fbe13 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/property_inline_get_type_error.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/property_inline_get_type_error.gd
@@ -1,7 +1,7 @@
-var _prop : int
+var _prop: int
# Inline getter returns int instead of String.
-var prop : String:
+var prop: String:
get:
return _prop
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/property_inline_set_type_error.gd b/modules/gdscript/tests/scripts/analyzer/errors/property_inline_set_type_error.gd
index 0ce239dbbd..5747b85fc7 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/property_inline_set_type_error.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/property_inline_set_type_error.gd
@@ -1,7 +1,7 @@
-var _prop : int
+var _prop: int
# Inline setter assigns String to int.
-var prop : String:
+var prop: String:
set(value):
_prop = value
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd b/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd
index 758fbaccc9..b0cfdea75d 100644
--- a/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd
+++ b/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd
@@ -7,4 +7,4 @@ func test():
x.free()
var ok = x
- var bad : A = x
+ var bad: A = x
diff --git a/modules/gdscript/tests/scripts/analyzer/features/enum_duplicate_into_dict.gd b/modules/gdscript/tests/scripts/analyzer/features/enum_duplicate_into_dict.gd
index 3076e7069f..8e6bb22a12 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/enum_duplicate_into_dict.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/enum_duplicate_into_dict.gd
@@ -1,7 +1,7 @@
enum Enum {V1, V2}
func test():
- var enumAsDict : Dictionary = Enum.duplicate()
+ var enumAsDict: Dictionary = Enum.duplicate()
var enumAsVariant = Enum.duplicate()
print(Enum.has("V1"))
print(enumAsDict.has("V1"))
diff --git a/modules/gdscript/tests/scripts/analyzer/features/enum_function_typecheck.gd b/modules/gdscript/tests/scripts/analyzer/features/enum_function_typecheck.gd
index 8a4e89d0d6..3a1863a1f4 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/enum_function_typecheck.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/enum_function_typecheck.gd
@@ -5,19 +5,19 @@ enum MyEnum { V0, V1, V2 }
class InnerClass:
enum MyEnum { V0, V2, V1 }
- func inner_inner_no_class(e : MyEnum) -> MyEnum:
+ func inner_inner_no_class(e: MyEnum) -> MyEnum:
print(e)
return e
- func inner_inner_class(e : InnerClass.MyEnum) -> InnerClass.MyEnum:
+ func inner_inner_class(e: InnerClass.MyEnum) -> InnerClass.MyEnum:
print(e)
return e
- func inner_inner_class_class(e : EnumFunctionTypecheckOuterClass.InnerClass.MyEnum) -> EnumFunctionTypecheckOuterClass.InnerClass.MyEnum:
+ func inner_inner_class_class(e: EnumFunctionTypecheckOuterClass.InnerClass.MyEnum) -> EnumFunctionTypecheckOuterClass.InnerClass.MyEnum:
print(e)
return e
- func inner_outer(e : EnumFunctionTypecheckOuterClass.MyEnum) -> EnumFunctionTypecheckOuterClass.MyEnum:
+ func inner_outer(e: EnumFunctionTypecheckOuterClass.MyEnum) -> EnumFunctionTypecheckOuterClass.MyEnum:
print(e)
return e
@@ -59,19 +59,19 @@ class InnerClass:
print()
-func outer_outer_no_class(e : MyEnum) -> MyEnum:
+func outer_outer_no_class(e: MyEnum) -> MyEnum:
print(e)
return e
-func outer_outer_class(e : EnumFunctionTypecheckOuterClass.MyEnum) -> EnumFunctionTypecheckOuterClass.MyEnum:
+func outer_outer_class(e: EnumFunctionTypecheckOuterClass.MyEnum) -> EnumFunctionTypecheckOuterClass.MyEnum:
print(e)
return e
-func outer_inner_class(e : InnerClass.MyEnum) -> InnerClass.MyEnum:
+func outer_inner_class(e: InnerClass.MyEnum) -> InnerClass.MyEnum:
print(e)
return e
-func outer_inner_class_class(e : EnumFunctionTypecheckOuterClass.InnerClass.MyEnum) -> EnumFunctionTypecheckOuterClass.InnerClass.MyEnum:
+func outer_inner_class_class(e: EnumFunctionTypecheckOuterClass.InnerClass.MyEnum) -> EnumFunctionTypecheckOuterClass.InnerClass.MyEnum:
print(e)
return e
diff --git a/modules/gdscript/tests/scripts/analyzer/features/enum_native_access_types.gd b/modules/gdscript/tests/scripts/analyzer/features/enum_native_access_types.gd
index 6a0a1e1969..0e4fd59267 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/enum_native_access_types.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/enum_native_access_types.gd
@@ -1,9 +1,9 @@
-func print_enum(e : TileSet.TileShape) -> TileSet.TileShape:
+func print_enum(e: TileSet.TileShape) -> TileSet.TileShape:
print(e)
return e
func test():
- var v : TileSet.TileShape
+ var v: TileSet.TileShape
v = TileSet.TILE_SHAPE_SQUARE
v = print_enum(v)
v = print_enum(TileSet.TILE_SHAPE_SQUARE)
diff --git a/modules/gdscript/tests/scripts/analyzer/features/enum_typecheck_inner_class.gd b/modules/gdscript/tests/scripts/analyzer/features/enum_typecheck_inner_class.gd
index b05ae82048..1c4b19d8e0 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/enum_typecheck_inner_class.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/enum_typecheck_inner_class.gd
@@ -7,9 +7,9 @@ class InnerClass:
static func test_inner_from_inner():
print("Inner - Inner")
- var e1 : MyEnum
- var e2 : InnerClass.MyEnum
- var e3 : EnumTypecheckOuterClass.InnerClass.MyEnum
+ var e1: MyEnum
+ var e2: InnerClass.MyEnum
+ var e3: EnumTypecheckOuterClass.InnerClass.MyEnum
print("Self ", e1, e2, e3)
e1 = MyEnum.V1
@@ -36,7 +36,7 @@ class InnerClass:
static func test_outer_from_inner():
print("Inner - Outer")
- var e : EnumTypecheckOuterClass.MyEnum
+ var e: EnumTypecheckOuterClass.MyEnum
e = EnumTypecheckOuterClass.MyEnum.V1
print("Outer.MyEnum ", e)
@@ -45,8 +45,8 @@ class InnerClass:
func test_outer_from_outer():
print("Outer - Outer")
- var e1 : MyEnum
- var e2 : EnumTypecheckOuterClass.MyEnum
+ var e1: MyEnum
+ var e2: EnumTypecheckOuterClass.MyEnum
print("Self ", e1, e2)
e1 = MyEnum.V1
@@ -63,8 +63,8 @@ func test_outer_from_outer():
func test_inner_from_outer():
print("Outer - Inner")
- var e1 : InnerClass.MyEnum
- var e2 : EnumTypecheckOuterClass.InnerClass.MyEnum
+ var e1: InnerClass.MyEnum
+ var e2: EnumTypecheckOuterClass.InnerClass.MyEnum
print("Inner ", e1, e2)
e1 = InnerClass.MyEnum.V1
diff --git a/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd
index 38bb7f6e9c..5b0e5c0bf0 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd
@@ -1,4 +1,4 @@
-var Value:int = 8 :
+var Value:int = 8:
get:
return Value
set(v):
diff --git a/modules/gdscript/tests/scripts/analyzer/features/property_inline.gd b/modules/gdscript/tests/scripts/analyzer/features/property_inline.gd
index 23eb011b23..474bb49a3b 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/property_inline.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/property_inline.gd
@@ -6,21 +6,21 @@ var prop1:
prop1 = value
# Typed inline property
-var prop2 : int:
+var prop2: int:
get:
return prop2
set(value):
prop2 = value
# Typed inline property with default value
-var prop3 : int = 1:
+var prop3: int = 1:
get:
return prop3
set(value):
prop3 = value
# Typed inline property with backing variable
-var _prop4 : int = 2
+var _prop4: int = 2
var prop4: int:
get:
return _prop4
diff --git a/modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd b/modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd
index beabf3d2e5..5fbc91be5e 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/use_preload_script_as_type.gd
@@ -1,4 +1,4 @@
-const preloaded : GDScript = preload("gdscript_to_preload.notest.gd")
+const preloaded: GDScript = preload("gdscript_to_preload.notest.gd")
func test():
var preloaded_instance: preloaded = preloaded.new()
diff --git a/modules/gdscript/tests/scripts/parser/features/static_typing.gd b/modules/gdscript/tests/scripts/parser/features/static_typing.gd
index d42632c82d..0157ca2128 100644
--- a/modules/gdscript/tests/scripts/parser/features/static_typing.gd
+++ b/modules/gdscript/tests/scripts/parser/features/static_typing.gd
@@ -1,3 +1,5 @@
+# Do not fix code style here!
+
func test():
# The following lines are equivalent:
var _integer: int = 1
diff --git a/modules/gdscript/tests/scripts/parser/features/static_typing.out b/modules/gdscript/tests/scripts/parser/features/static_typing.out
index 92ce7bc0e0..207d90fef1 100644
--- a/modules/gdscript/tests/scripts/parser/features/static_typing.out
+++ b/modules/gdscript/tests/scripts/parser/features/static_typing.out
@@ -1,21 +1,21 @@
GDTEST_OK
>> WARNING
->> Line: 9
+>> Line: 11
>> UNUSED_LOCAL_CONSTANT
>> The local constant '_INTEGER' is declared but never used in the block. If this is intended, prefix it with an underscore: '__INTEGER'
>> WARNING
->> Line: 10
+>> Line: 12
>> UNUSED_LOCAL_CONSTANT
>> The local constant '_INTEGER_REDUNDANT_TYPED' is declared but never used in the block. If this is intended, prefix it with an underscore: '__INTEGER_REDUNDANT_TYPED'
>> WARNING
->> Line: 11
+>> Line: 13
>> UNUSED_LOCAL_CONSTANT
>> The local constant '_INTEGER_REDUNDANT_TYPED2' is declared but never used in the block. If this is intended, prefix it with an underscore: '__INTEGER_REDUNDANT_TYPED2'
>> WARNING
->> Line: 12
+>> Line: 14
>> UNUSED_LOCAL_CONSTANT
>> The local constant '_INTEGER_REDUNDANT_INFERRED' is declared but never used in the block. If this is intended, prefix it with an underscore: '__INTEGER_REDUNDANT_INFERRED'
>> WARNING
->> Line: 13
+>> Line: 15
>> UNUSED_LOCAL_CONSTANT
>> The local constant '_INTEGER_REDUNDANT_INFERRED2' is declared but never used in the block. If this is intended, prefix it with an underscore: '__INTEGER_REDUNDANT_INFERRED2'
diff --git a/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd b/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd
index 03278e453f..0851d939dc 100644
--- a/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd
@@ -1,8 +1,8 @@
extends Node
@onready var later_inferred := [1]
-@onready var later_static : Array
-@onready var later_static_with_init : Array = [1]
+@onready var later_static: Array
+@onready var later_static_with_init: Array = [1]
@onready var later_untyped = [1]
func test():
diff --git a/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd b/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd
index 3eb02816ed..14c93eb159 100644
--- a/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd
@@ -1,5 +1,5 @@
#GDTEST_OK
-var prop : int = 0:
+var prop: int = 0:
get:
return prop
set(value):
diff --git a/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd b/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd
index efa8270526..20b024f09e 100644
--- a/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/use_conversion_assign_with_variant_value.gd
@@ -4,6 +4,6 @@ func test():
@warning_ignore("narrowing_conversion")
var foo: int = 0.0
print(typeof(foo) == TYPE_INT)
- var dict : Dictionary = {"a":0.0}
+ var dict: Dictionary = {"a": 0.0}
foo = dict.get("a")
print(typeof(foo) == TYPE_INT)