From 4abbb2d684aa1d7edfcf98a37fe60e9824837d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 22 Nov 2022 14:36:51 +0100 Subject: GDScript: Don't warn about RETURN_VALUE_DISCARDED by default This happens too often with normal usage of the API. The warning can still be useful to find actual bugs where discarding the return value wasn't intentional, but this should stay enabled manually, at least until we either improve the API to remove false positives, or improve the warning (e.g. to only warn about unused return value on const functions). --- modules/gdscript/gdscript_warning.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/gdscript/gdscript_warning.cpp') diff --git a/modules/gdscript/gdscript_warning.cpp b/modules/gdscript/gdscript_warning.cpp index 2548d26e14..36bc051643 100644 --- a/modules/gdscript/gdscript_warning.cpp +++ b/modules/gdscript/gdscript_warning.cpp @@ -171,6 +171,10 @@ int GDScriptWarning::get_default_value(Code p_code) { if (get_name_from_code(p_code).to_lower().begins_with("unsafe_")) { return WarnLevel::IGNORE; } + // Too spammy by default on common cases (connect, Tween, etc.). + if (p_code == RETURN_VALUE_DISCARDED) { + return WarnLevel::IGNORE; + } return WarnLevel::WARN; } -- cgit v1.2.3