diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-11-08 09:18:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-08 09:18:38 +0100 |
commit | 381a5f2138340293b37b4d3180418865d435c114 (patch) | |
tree | 5df6ed97e01198b2a8e462c88e46c4cbc59cb8da /modules | |
parent | 1f76229378409cc3d4147064e80d4ec754629322 (diff) | |
parent | d7137a6b7233c6867c717883a61a1c3607ae84e5 (diff) |
Merge pull request #33437 from mashumafi/exclude-addons
Additional setting to prevent warnings in addons
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 1 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index edb296437b..b90fab8221 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -2141,6 +2141,7 @@ GDScriptLanguage::GDScriptLanguage() { #ifdef DEBUG_ENABLED GLOBAL_DEF("debug/gdscript/warnings/enable", true); GLOBAL_DEF("debug/gdscript/warnings/treat_warnings_as_errors", false); + GLOBAL_DEF("debug/gdscript/warnings/exclude_addons", true); GLOBAL_DEF("debug/gdscript/completion/autocomplete_setters_and_getters", false); for (int i = 0; i < (int)GDScriptWarning::WARNING_MAX; i++) { String warning = GDScriptWarning::get_name_from_code((GDScriptWarning::Code)i).to_lower(); diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 9d229adb2a..74b9440b3a 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -8373,6 +8373,9 @@ void GDScriptParser::_add_warning(int p_code, int p_line, const String &p_symbol } void GDScriptParser::_add_warning(int p_code, int p_line, const Vector<String> &p_symbols) { + if (GLOBAL_GET("debug/gdscript/warnings/exclude_addons").booleanize() && base_path.begins_with("res://addons/")) { + return; + } if (tokenizer->is_ignoring_warnings() || !GLOBAL_GET("debug/gdscript/warnings/enable").booleanize()) { return; } |