1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

Fix a few GDScript warning messages for grammar and consistency

Regenerate test results

Improve warning message for `INT_AS_ENUM_WITHOUT_CAST`

Improve `REDUNDANT_AWAIT` message and regenerate tests

Allow warning message for UNASSIGNED_VARIABLE_OP_ASSIGN to display specific operator

Remove "being" from some messages to make them consistent and clearer

Update expected test results

Use Variant::get_operator_name for determining string representation of operator instead of big switch-case

Update tests

Update modules/gdscript/gdscript_warning.cpp

Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>

Update tests... again
This commit is contained in:
Malcolm Anderson
2025-03-28 09:47:46 -07:00
parent 6a6a1168a5
commit d8db03e31a
11 changed files with 57 additions and 57 deletions

View File

@@ -1,21 +1,21 @@
GDTEST_OK
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
~~ WARNING at line 19: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.
2.718
2.718

View File

@@ -1,8 +1,8 @@
GDTEST_OK
~~ WARNING at line 5: (INT_AS_ENUM_WITHOUT_CAST) Integer used when an enum value is expected. If this is intended cast the integer to the enum type.
~~ WARNING at line 9: (INT_AS_ENUM_WITHOUT_CAST) Integer used when an enum value is expected. If this is intended cast the integer to the enum type.
~~ WARNING at line 12: (INT_AS_ENUM_WITHOUT_CAST) Integer used when an enum value is expected. If this is intended cast the integer to the enum type.
~~ WARNING at line 14: (INT_AS_ENUM_WITHOUT_CAST) Integer used when an enum value is expected. If this is intended cast the integer to the enum type.
~~ WARNING at line 5: (INT_AS_ENUM_WITHOUT_CAST) Integer used when an enum value is expected. If this is intended, cast the integer to the enum type using the "as" keyword.
~~ WARNING at line 9: (INT_AS_ENUM_WITHOUT_CAST) Integer used when an enum value is expected. If this is intended, cast the integer to the enum type using the "as" keyword.
~~ WARNING at line 12: (INT_AS_ENUM_WITHOUT_CAST) Integer used when an enum value is expected. If this is intended, cast the integer to the enum type using the "as" keyword.
~~ WARNING at line 14: (INT_AS_ENUM_WITHOUT_CAST) Integer used when an enum value is expected. If this is intended, cast the integer to the enum type using the "as" keyword.
0
1
0

View File

@@ -1,2 +1,2 @@
GDTEST_OK
~~ WARNING at line 3: (INTEGER_DIVISION) Integer division, decimal part will be discarded.
~~ WARNING at line 3: (INTEGER_DIVISION) Integer division. Decimal part will be discarded.

View File

@@ -1,4 +1,4 @@
GDTEST_OK
~~ WARNING at line 2: (STANDALONE_TERNARY) Standalone ternary operator: the return value is being discarded.
~~ WARNING at line 3: (STANDALONE_TERNARY) Standalone ternary operator: the return value is being discarded.
~~ WARNING at line 2: (STANDALONE_TERNARY) Standalone ternary operator (the return value is being discarded).
~~ WARNING at line 3: (STANDALONE_TERNARY) Standalone ternary operator (the return value is being discarded).
1

View File

@@ -1,7 +1,7 @@
GDTEST_OK
~~ WARNING at line 3: (UNASSIGNED_VARIABLE) The variable "unassigned" was used before being assigned a value.
~~ WARNING at line 7: (UNASSIGNED_VARIABLE) The variable "a" was used before being assigned a value.
~~ WARNING at line 8: (UNASSIGNED_VARIABLE) The variable "a" was used before being assigned a value.
~~ WARNING at line 3: (UNASSIGNED_VARIABLE) The variable "unassigned" is used before being assigned a value.
~~ WARNING at line 7: (UNASSIGNED_VARIABLE) The variable "a" is used before being assigned a value.
~~ WARNING at line 8: (UNASSIGNED_VARIABLE) The variable "a" is used before being assigned a value.
<null>
<null>
<null>

View File

@@ -1,2 +1,2 @@
GDTEST_OK
~~ WARNING at line 4: (UNASSIGNED_VARIABLE_OP_ASSIGN) Using assignment with operation but the variable "__" was not previously assigned a value.
~~ WARNING at line 4: (UNASSIGNED_VARIABLE_OP_ASSIGN) The variable "__" is modified with the compound-assignment operator "+=" but was not previously initialized.