forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request godotengine#90794 from vnen/gdscript-no-unused-con…
…stant-warning-with-underscore GDScript: Suppress unused constant warning with underscore
- Loading branch information
Showing
5 changed files
with
10 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
modules/gdscript/tests/scripts/parser/features/constants.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1 @@ | ||
GDTEST_OK | ||
>> WARNING | ||
>> Line: 2 | ||
>> UNUSED_LOCAL_CONSTANT | ||
>> The local constant "_TEST" is declared but never used in the block. If this is intended, prefix it with an underscore: "__TEST". | ||
>> WARNING | ||
>> Line: 3 | ||
>> UNUSED_LOCAL_CONSTANT | ||
>> The local constant "_STRING" is declared but never used in the block. If this is intended, prefix it with an underscore: "__STRING". | ||
>> WARNING | ||
>> Line: 4 | ||
>> UNUSED_LOCAL_CONSTANT | ||
>> The local constant "_VECTOR" is declared but never used in the block. If this is intended, prefix it with an underscore: "__VECTOR". | ||
>> WARNING | ||
>> Line: 5 | ||
>> UNUSED_LOCAL_CONSTANT | ||
>> The local constant "_ARRAY" is declared but never used in the block. If this is intended, prefix it with an underscore: "__ARRAY". | ||
>> WARNING | ||
>> Line: 6 | ||
>> UNUSED_LOCAL_CONSTANT | ||
>> The local constant "_DICTIONARY" is declared but never used in the block. If this is intended, prefix it with an underscore: "__DICTIONARY". | ||
>> WARNING | ||
>> Line: 9 | ||
>> UNUSED_LOCAL_CONSTANT | ||
>> The local constant "_HELLO" is declared but never used in the block. If this is intended, prefix it with an underscore: "__HELLO". | ||
>> WARNING | ||
>> Line: 10 | ||
>> UNUSED_LOCAL_CONSTANT | ||
>> The local constant "_INFINITY" is declared but never used in the block. If this is intended, prefix it with an underscore: "__INFINITY". | ||
>> WARNING | ||
>> Line: 11 | ||
>> UNUSED_LOCAL_CONSTANT | ||
>> The local constant "_NOT_A_NUMBER" is declared but never used in the block. If this is intended, prefix it with an underscore: "__NOT_A_NUMBER". |
20 changes: 0 additions & 20 deletions
20
modules/gdscript/tests/scripts/parser/features/static_typing.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
GDTEST_OK | ||
>> WARNING | ||
>> 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: 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: 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: 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: 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". |
4 changes: 4 additions & 0 deletions
4
modules/gdscript/tests/scripts/parser/warnings/unused_constant.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
func test(): | ||
const UNUSED = "not used" | ||
|
||
const _UNUSED = "not used, but no warning since the constant name starts with an underscore" |
5 changes: 5 additions & 0 deletions
5
modules/gdscript/tests/scripts/parser/warnings/unused_constant.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
GDTEST_OK | ||
>> WARNING | ||
>> Line: 2 | ||
>> UNUSED_LOCAL_CONSTANT | ||
>> The local constant "UNUSED" is declared but never used in the block. If this is intended, prefix it with an underscore: "_UNUSED". |