Skip to content

function-preload-variable-name requires PascalCase for preloaded scenes #418

Description

@idbrii

The Godot Style Guide recommends PascalCase for preloaded classes:

Also use PascalCase when loading a class into a constant or a variable:

const Weapon = preload("res://weapon.gd")

But gdlint applies this restriction to preloaded assets too:

	var visual_scene:= preload("res://scenes/bot_visual.tscn")
	var visual: BotAnim = visual_scene.instantiate()

result:
  Error: Function-scope preload variable name "visual_scene" is not valid (function-preload-variable-name)

I think gdlint should limit the name restriction to preloads that end with ".gd" or skip ones that end with ".tscn". More likely the former since preload is so general and the restriction is only for classes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions