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

gdlint: Calling super._ready() raises error #308

Closed
yeslayla opened this issue Jun 23, 2024 · 3 comments
Closed

gdlint: Calling super._ready() raises error #308

yeslayla opened this issue Jun 23, 2024 · 3 comments
Labels
bug Something isn't working linter

Comments

@yeslayla
Copy link
Contributor

Here's an example of the use-case implementation

class_name Parent
extends Node

func _ready() -> void:
    print("Hello from Parent")
extends Parent

func _ready() -> void:
    super._ready() # Private method "_ready" has been called (private-method-call)
    print("Hello from Child")

I was looking around to see if calling super._ready() or super._process(delta) was a bad practice, but from what I've read it seems to be a relatively common way of doing things. So ideally I think calling private methods on super should be fine.

Similar to #283

@Scony Scony added bug Something isn't working linter labels Jun 24, 2024
@Jack-023
Copy link

I think this is a more general problem with this rule. In gdscript the styleguide says you should start the name of virtual methods with an _, even if the methods are intended to be public. Using the same character for two different meanings makes it pretty difficult to handle with a linter/formatter.

Maybe it is worth removing this rule from the linter?

@Scony
Copy link
Owner

Scony commented Jul 31, 2024

I think this is a more general problem with this rule. In gdscript the styleguide says you should start the name of virtual methods with an _, even if the methods are intended to be public. Using the same character for two different meanings makes it pretty difficult to handle with a linter/formatter.

Maybe it is worth removing this rule from the linter?

Yes, I'll probably remove that rule as it makes very little sense in case of GDScript

@Jack-023
Copy link

Jack-023 commented Aug 5, 2024

I made a proposal to update the style guide. Not sure if it will go anywhere yet but I figured it was worth sharing here as it is directly related to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linter
Projects
None yet
Development

No branches or pull requests

3 participants