Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static analyzer for Godot projects #19811

Closed
vnen opened this issue Jun 27, 2018 · 3 comments
Closed

Static analyzer for Godot projects #19811

vnen opened this issue Jun 27, 2018 · 3 comments

Comments

@vnen
Copy link
Member

vnen commented Jun 27, 2018

Following up from typed GDScript (#10630, #19264), one thing that a lot of people seems to be missing is to detect type-errors more thoroughly than what the type hints can provide.

My proposal is to make a full project static analyzer tool. The idea is that it runs the whole project and look at the scripts in the context where they are attached to nodes in the scene. It would look not only to scripts themselves but also all the scenes and resources and how the relate to each other.

This is not a thing to be used all the time and would be triggered manually, so it doesn't need to be fast. It would be used only before exporting or after a big refactoring.

There are some potential errors that it could catch:

  • Script refers to a non-existent node in the scene (which can happen when deleting nodes / reorganizing the tree).
  • Script refers to a non-existent method/property in the node (which can happen in a change type operation).
  • Script does not inherit the object type it's attached to (can happen when changing type, but also when inheriting another script).
  • Wrong arguments declared in a function connected to a signal (both arity and types).
  • Orphan resources (there's already a tool for that, but could be replaced by this one).
  • Scenes pointing to non-existing resources (can happen when messing with the file-system outside of Godot, sometimes even inside).
  • Scenes setting resources of wrong type to properties (hard to happen but also hard to catch).

Among many other things, in particular about the scripts since they can be target of many checks if we can spare performance.

@letheed
Copy link
Contributor

letheed commented Aug 28, 2018

Has something like a language server been considered?

@vnen
Copy link
Member Author

vnen commented Aug 28, 2018

@letheed see #2245

@Calinou
Copy link
Member

Calinou commented May 26, 2020

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants