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

Extend VarCouldBeVal Rule to Include Class/Object Properties #1330

Closed
tylerbwong opened this issue Nov 13, 2018 · 5 comments
Closed

Extend VarCouldBeVal Rule to Include Class/Object Properties #1330

tylerbwong opened this issue Nov 13, 2018 · 5 comments

Comments

@tylerbwong
Copy link
Contributor

Expected Behavior of the rule

Currently, the VarCouldBeVal rule only reports on locally-scoped function variables. It would be nice if the rule could be extended to include private top-level class/object properties as well.

For example

class Test {
    private var viewModel = BaseViewModel() // Not re-assigned anywhere else in the class
    ...
}

should report a violation.

Context

Theses are valid errors that should be reported to fix unnecessary mutability.

@tylerbwong
Copy link
Contributor Author

I'll actually go ahead and give this one a shot 👍

@schalkms
Copy link
Member

@tylerbwong do you any update on this feature? Do you need assistance?

@tylerbwong
Copy link
Contributor Author

Hey @schalkms sorry for the late reply. I've actually haven't found the time to work on this lately so it'd probably be best to let someone else work on it 😞

@schalkms
Copy link
Member

@tylerbwong no worries.. thanks for the reply.

@BraisGabin
Copy link
Member

This was implemented on 1.20 🎉

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