|
15 | 15 | "icon",
|
16 | 16 | "tool",
|
17 | 17 | ]
|
| 18 | + |
| 19 | +""" |
| 20 | +Source: https://github.com/godotengine/godot/blob/master/modules/gdscript/gdscript_warning.h |
| 21 | +Source last updated: 2025-01-09 |
| 22 | +
|
| 23 | +Unused because not applicable to functions: |
| 24 | +- "unused_variable" |
| 25 | +- "unused_local_constant" |
| 26 | +- "shadowed_variable" |
| 27 | +- "shadowed_variable_base_class" |
| 28 | +- "missing_tool" |
| 29 | +- "empty_file" |
| 30 | +- "unused_private_class_variable" |
| 31 | +- "unused_signal" |
| 32 | +- "redundant_static_unload" |
| 33 | +- "get_node_default_without_onready" |
| 34 | +- "onready_with_export" |
| 35 | +
|
| 36 | +Unused because deprecated: |
| 37 | +- "property_used_as_function" |
| 38 | +- "constant_used_as_function" |
| 39 | +- "function_used_as_property" |
| 40 | +""" |
18 | 41 | _NON_STANDALONE_WARNING_IGNORES = [
|
| 42 | + # Variable used but never assigned. |
| 43 | + "unassigned_variable", |
| 44 | + # Variable never assigned but used in an assignment operation (+=, *=, etc). |
| 45 | + "unassigned_variable_op_assign", |
| 46 | + # Function parameter is never used. |
19 | 47 | "unused_parameter",
|
| 48 | + # A global class or function has the same name as variable. |
| 49 | + "shadowed_global_identifier", |
| 50 | + # Code after a return statement. |
| 51 | + "unreachable_code", |
| 52 | + # Pattern in a match statement after a catch all pattern (wildcard or bind). |
| 53 | + "unreachable_pattern", |
| 54 | + # Expression not assigned to a variable. |
| 55 | + "standalone_expression", |
| 56 | + # Return value of ternary expression is discarded. |
| 57 | + "standalone_ternary", |
| 58 | + # Possible values of a ternary if are not mutually compatible. |
| 59 | + "incompatible_ternary", |
| 60 | + # Variable/parameter/function has no static type, explicitly specified or implicitly inferred. |
| 61 | + "untyped_declaration", |
| 62 | + # Variable/constant/parameter has an implicitly inferred static type. |
| 63 | + "inferred_declaration", |
| 64 | + # Property not found in the detected type (but can be in subtypes). |
| 65 | + "unsafe_property_access", |
| 66 | + # Function not found in the detected type (but can be in subtypes). |
| 67 | + "unsafe_method_access", |
| 68 | + # Casting a `variant` value to non-`variant`. |
| 69 | + "unsafe_cast", |
| 70 | + # Function call argument is of a supertype of the required type. |
| 71 | + "unsafe_call_argument", |
| 72 | + # Function returns void but returned a call to a function that can't be type checked. |
| 73 | + "unsafe_void_return", |
| 74 | + # Function call returns something but the value isn't used. |
| 75 | + "return_value_discarded", |
| 76 | + # A static method was called on an instance of a class instead of on the class itself. |
| 77 | + "static_called_on_instance", |
| 78 | + # Await is used but expression is synchronous (not a signal nor a coroutine). |
| 79 | + "redundant_await", |
| 80 | + # Expression for assert argument is always true. |
| 81 | + "assert_always_true", |
| 82 | + # Expression for assert argument is always false. |
| 83 | + "assert_always_false", |
| 84 | + # Integer divide by integer, decimal part is discarded. |
| 85 | + "integer_division", |
| 86 | + # Float value into an integer slot, precision is lost. |
| 87 | + "narrowing_conversion", |
| 88 | + # An integer value was used as an enum value without casting. |
| 89 | + "int_as_enum_without_cast", |
| 90 | + # An integer value was used as an enum value without matching enum member. |
| 91 | + "int_as_enum_without_match", |
| 92 | + # A variable with an enum type does not have a default value. the default will be set to `0` |
| 93 | + # instead of the first enum value. |
| 94 | + "enum_variable_without_default", |
| 95 | + # The keyword is deprecated and should be replaced. |
| 96 | + "deprecated_keyword", |
| 97 | + # The identifier contains misleading characters that can be confused. e.g. "usеr" |
| 98 | + # (has cyrillic "е" instead of latin "e"). |
| 99 | + "confusable_identifier", |
| 100 | + # The parent block declares an identifier with the same name below. |
| 101 | + "confusable_local_declaration", |
| 102 | + # The identifier will be shadowed below in the block. |
| 103 | + "confusable_local_usage", |
| 104 | + # Reassigning lambda capture does not modify the outer local variable. |
| 105 | + "confusable_capture_reassignment", |
| 106 | + # The declaration uses type inference but the value is typed as variant. |
| 107 | + "inference_on_variant", |
| 108 | + # The script method overrides a native one, this may not work as intended. |
| 109 | + "native_method_override", |
20 | 110 | ]
|
21 | 111 |
|
22 | 112 |
|
|
0 commit comments