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

No rule for default values being set on init #87

Open
charlie-abbott-deltatre opened this issue May 26, 2023 · 2 comments
Open

No rule for default values being set on init #87

charlie-abbott-deltatre opened this issue May 26, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@charlie-abbott-deltatre
Copy link
Contributor

charlie-abbott-deltatre commented May 26, 2023

There is currently no rule for catching redundant default values being set on init, so node.visible = true or node.translation = [0, 0] or within the XML <Rectangle visible="true" />

@TwitchBronBron
Copy link
Member

In XML files, <Rectangle visible="true" /> this. could be a good rule and fairly easy to implement other than maintaining the large list of default values somewhere. But I think it might be incredibly difficult to detect these in brs/bs code. Consider this code:

sub init()
    m.top.visible = false
    if getRegistryValue("something") = true
        m.top.visibile = true
    end if
end sub

What should we do in that situation? Should it be flagged?

@TwitchBronBron TwitchBronBron added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jun 29, 2023
@charlie-abbott-deltatre
Copy link
Contributor Author

Agree, this should fairly easy with XML, except for the work of defining/ maintaining the default values list per node type.

For brs/bs code there are potentially a lot of edge cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants