-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@warning_ignore()
annotation don't work with all warnings
#56592
Comments
PS: This is a good opportunity to add some GDScript integration tests while fixing this issue. |
@warning_ignore()
annotation don't work with all warnings
Can confirm UNREACHABLE_PATTERN is also not ignored: class test_entity:
func test_function() -> void:
var x = 2
@warning_ignore(unreachable_pattern)
match x:
1:
return
_:
return
3: # UNREACHABLE_PATTERN
return |
Can confirm in 4.0 alpha 13 for the following warnings:
In addition, using the code posted by @EvelynTSMG in the above comment prints one more warning which is not ignored:
|
Warning for integer division not ignored if it in for loop condition extends Node
var a : int = 6
var b : int = 2
var c : int
func _ready():
@warning_ignore(integer_division)
for i in range(a / b): # Warning!
pass
@warning_ignore(integer_division)
c = a / b # No warnings |
In 4.0 alpha 15,
extends Node
var foo
func test():
# warning ignored
@warning_ignore(shadowed_variable_base_class)
var name
# warning *not* ignored
@warning_ignore(shadowed_variable_base_class)
for name in []:
pass
# warning ignored
@warning_ignore(shadowed_variable)
var foo
# warning *not* ignored
@warning_ignore(shadowed_variable)
for foo in []:
pass |
[4.0 alpha 15] Also doesn't seem to ignore extends Area2D
@warning_ignore(int_assigned_to_enum)
@export var active_process_mode:ProcessMode = PROCESS_MODE_INHERIT
|
[4.0 beta 2]
These warnings are disabled by default so I'm reporting them so they don't slip trough somehow |
The current documentation is very incomplete. What is the replacement for I would guess e.i
But it sill reports warning when loading via load(<script_path>)
|
Hi on Godot 3 we was able to ignore ALL warnings at class level On Godot 4 i missed this option Please bring it back.
This parameter is only used by the internal test executor to terminate the test after the timeout. To avoid this, I would like it to return to the ability to disable all warnings at the class level. And |
Adding a |
Ah nice, so it should work :) |
|
Godot v4.0.stable.official [92bee43] ignore
using |
# Why By default addons are excluded from code validation, after inclusion the plugin displays over 1800 warnings and some errors ![image](https://user-images.githubusercontent.com/347037/223846970-74dc362b-dcd2-48a0-9a6b-7137e4c1671b.png) # What - fix the errors - reduce the warnings - update inline documentation - apply formatting rules # Open issues -Only 23 warnings left, covered by the listed Godot issues ![image](https://user-images.githubusercontent.com/347037/224134816-2f3729bd-4aac-4cc5-af6d-3934b49a1b2f.png) - invalid warnings about enum [74593](godotengine/godot#74593) - INT_AS_ENUM_WITHOUT_CAST - INT_AS_ENUM_WITHOUT_MATCH - disable warnings not work [56592](godotengine/godot#56592) - shadowed_global_identifier
Is there an update here? Would be nice if the ignore annotations would also work as described ;) |
There are no updates yet, as far as I know. I plan to take a look later (added to my TODO list). |
Thank you, that sounds very good. 👍 |
@warning_ignore()
annotation don't work with all warnings@warning_ignore()
annotation don't work with all warnings
At least, with This works: @warning_ignore("incompatible_ternary")
foo.bar(
baz if abc else null
) while neither of these do not: # warning-ignore:incompatible_ternary
foo.bar(
baz if abc else null
) foo.bar(
# warning-ignore:incompatible_ternary
baz if abc else null
) Also, I noticed, while the comment pattern for warning suppression seems to be documented in https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/warning_system.html, the annotation pattern isn't. Windows 11, v4.1.stable.official [9704596] |
After the recent #79880 PR, I am getting additional @warning_ignore("confusable_local_declaration")
var my_func := func my_func(param := 0) -> void:
print(param)
var param := 1
my_func.call(param) The warning about |
I also found that
|
Godot version
4.0.dev.custom_build.096a13b3b
System information
Linux, 5.16.0-1-MANJARO
Issue description
The annotation "@warning_ignore" don't ignore all warnings properly, some are still raised even with the annotation
Properly ignored warnings:
Not ignored warnings:
Untested warnings:
Steps to reproduce
Use this code as a new script and look at the warning section.
Minimal reproduction project
test_warning_ignore.zip
The text was updated successfully, but these errors were encountered: