Merge pull request #34271 from vnen/gdscript-unused-class-variable-disable

Disable GDScript warning for unused class variable by default
This commit is contained in:
Rémi Verschelde 2019-12-11 16:27:42 +01:00 committed by GitHub
commit 98c3990f7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2143,7 +2143,8 @@ GDScriptLanguage::GDScriptLanguage() {
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();
GLOBAL_DEF("debug/gdscript/warnings/" + warning, !warning.begins_with("unsafe_"));
bool default_enabled = !warning.begins_with("unsafe_") && i != GDScriptWarning::UNUSED_CLASS_VARIABLE;
GLOBAL_DEF("debug/gdscript/warnings/" + warning, default_enabled);
}
#endif // DEBUG_ENABLED
}