summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_warning.cpp
AgeCommit message (Collapse)Author
2023-02-02GDScript: Add warnings that are set to error by defaultGeorge Marques
- Adds a list of default levels for all warning so they can be set individually. - Add warnings set by default to error for: - Using `get_node()` without `@onready`. - Using `@onready` together with `@export`. - Inferring a static type with a Variant value. - Overriding a native engine method. - Adjust how annotations to ignore warnings are treated so they also apply to method parameters. - Clean up a bit how ignored warnings are set. There were two sets but only one was actually being used. - Set all warnings to the `WARN` level for tests, so they they can be properly tested. - Fix enum types in native methods signatures being set to `int`. - Fix native enums being treated as Dictionary by mistake. - Make name of native enum types use the class they are defined in, not the direct super class of the script. This ensures they are always equal even when coming from different sources. - Fix error for signature mismatch that was only showing the first default argument as having a default. Now it shows for all.
2023-02-01Revert "GDScript: Add warnings that are set to error by default"Rémi Verschelde
This reverts commit a166833bfa23a21a7bff196a85a20b014e7c1396. This caused multiple regressions. Needs to be redone with more testing before merge. Fixes #72501.
2023-02-01GDScript: Add warnings that are set to error by defaultGeorge Marques
- Adds a list of default levels for all warning so they can be set individually. - Add warnings set by default to error for: - Using `get_node()` without `@onready`. - Using `@onready` together with `@export`. - Inferring a static type with a Variant value. - Overriding a native engine method. - Adjust how annotations to ignore warnings are treated so they also apply to method parameters. - Clean up a bit how ignored warnings are set. There were two sets but only one was actually being used. - Set all warnings to the `WARN` level for tests, so they they can be properly tested. - Fix enum types in native methods signatures being set to `int`. - Fix native enums being treated as Dictionary by mistake. - Make name of native enum types use the class they are defined in, not the direct super class of the script. This ensures they are always equal even when coming from different sources. - Fix error for signature mismatch that was only showing the first default argument as having a default. Now it shows for all.
2023-01-31Merge pull request #72206 from vnen/gdscript-allow-void-return-shorthandRémi Verschelde
GDScript: Allow void functions to return calls to other void functions
2023-01-31Merge pull request #57520 from jordigcs/gd-rename-mapRémi Verschelde
Add hint for identifiers renamed from 3.x to 4.0
2023-01-31GDScript: Allow void functions to return calls to other void functionsGeorge Marques
2023-01-29GDScript: Fix constant conversionsDmitrii Maganov
2023-01-24Add hint for identifiers renamed since Godot 3jordi
2023-01-21Add support for Unicode identifiers in GDScriptGeorge Marques
This is using an adapted version of UAX#31 to not rely on the ICU database (which isn't available in builds without TextServerAdvanced). It allows most characters used in diverse scripts but not everything.
2023-01-05One Copyright Update to rule them allRémi Verschelde
As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
2022-12-30GDScript: Make using return of void function an errorGeorge Marques
Remove the `VOID_ASSIGNMENT` warning since those cases will be errors now.
2022-11-22GDScript: Don't warn about RETURN_VALUE_DISCARDED by defaultRémi Verschelde
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).
2022-11-21change RETURN_VALUE_DISCARDED GDScript warn textsouplamp
changed RETURN_VALUE_DISCARDED GDscript warning text to mention how the return value of a function is discarded; update GDScript parser warning test to include new warning text.
2022-10-14Add STATIC_CALLED_ON_INSTANCE warning to highlightclayjohn
when static functions are called directly from objects
2022-04-06Add enum values (Ignore, Warn, Error) to GDScript warningsjordi
2022-02-03GDScript: Consolidate behavior for assigning enum typesGeorge Marques
This makes sure that assigning values to enum-typed variables are consistent. Same enum is always valid, different enum is always invalid (without casting) and assigning `int` creates a warning if there is no casting. There are new test cases to ensure this behavior doesn't break in the future.
2022-01-05Merge pull request #56483 from vnen/gdscript-warning-annotationRémi Verschelde
Add annotation to ignore warnings
2022-01-04GDScript: Add annotation to ignore warningsGeorge Marques
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-11-13Allow using built-in names for variables, push warnings insteadYuri Roubinsky
2021-09-11Fix error on parsing statement-less GDScript files,ThreeRhinosInAnElephantCostume
add an empty file warning, add relevant tests.
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-07-20Add warning checks in GDScript analyzerGeorge Marques
Reenable checking those when validating code.
2020-07-20New GDScript tokenizer and parserGeorge Marques
Sometimes to fix something you have to break it first. This get GDScript mostly working with the new tokenizer and parser but a lot of things isn't working yet. It compiles and it's usable, and that should be enough for now. Don't worry: other huge commits will come after this.