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

Project settings: add Debug > GDScript > Warnings parameter to include/exclude specific add-ons #9146

Open
hsandt opened this issue Feb 21, 2024 · 1 comment

Comments

@hsandt
Copy link

hsandt commented Feb 21, 2024

Describe the project you are working on

A platformer

Describe the problem or limitation you are having in your project

Currently, we only have the flag debug/gdscript/warnings/exclude_addons to exclude all addons. If disabled, all addons are checked for warnings. I only need to verify my custom addon code in development, not 3rd party addons which may have many warnings, some of them considered as errors by default and preventing run (e.g. with GUT: bitwes/Gut#569)

Workaround: move your add-on in development outside the add-ons folder. This only works if it doesn't require to be under addons. You may have, like me, to modify any absolute resource path res://addons/ with relative paths res://./ or res://../, etc.****

Describe the feature / enhancement and how it helps to overcome the problem or limitation

A project setting to either whitelist or blacklist addons (or folders) to enable warnings for would be helpful.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

To simplify I'll just take the case of blacklisting, which is easier to understand along with exclude_addons:

  • add a new project setting debug/gdscript/warnings/excluded_addons where you checkbox a list of addons to exclude from warnings. The addons are listed the same way as in the Project Settings > Plugins tab, identified by ID but displayed with readable name
  • alternatively, property could be namedexcluded_addon_folders and contain a list of directory paths - however, this seems harder to enforce that user is selecting an add-on. If we implement this, we may as well implement a generic folder blacklisting across the whole project for users who really want to exclude specific folders from warning checks (but no use case in mind)
  • if debug/gdscript/warnings/exclude_addons is checked, all addons are ignored for warnings
  • if debug/gdscript/warnings/exclude_addons is unchecked but debug/gdscript/warnings/excluded_addons contains some addon IDs, those addons are ignored for warnings
  • if an addon in the list of excluded addons is removed in the meantime, it can stay in the list but will appear in yellow with a hover tooltip "addon not found in project"

If this enhancement will not be used often, can it be worked around with a few lines of script?

It is difficult to force the parser to ignore some folders without temporarily moving them out of the project... In the case of GUT, it's easier as as long as you don't run GUT tests, GUT scripts won't be parsed, but for other plugins which contain nodes and editor scripts used in the scene, it seems difficult to remove/disable them.

Is there a reason why this should be core and not an add-on in the asset library?

It deals with the native warning system and would play nice along the existing

@Mickeon
Copy link

Mickeon commented Feb 22, 2024

I'd rather have the more broad "blacklisting folders" solution. It's fairly easy to imagine why.

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