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

Add PropertyUsedBeforeDeclaration rule #6062

Merged
merged 1 commit into from
May 9, 2023
Merged

Conversation

t-kameyama
Copy link
Contributor

Fixes #749

@detekt-ci detekt-ci added the rules label May 1, 2023
@detekt-ci
Copy link
Collaborator

Messages
📖 Thanks for adding a new rule to detekt ❤️
We detekted that you added tests, to your rule, that's awesome!

We detekted that you updated the default-detekt-config.yml file, that's awesome!

Generated by 🚫 dangerJS against 890d24c

Copy link
Member

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@cortinico cortinico added this to the 1.23.0 milestone May 1, 2023
@cortinico cortinico added the notable changes Marker for notable changes in the changelog label May 1, 2023
Copy link
Member

@schalkms schalkms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thank you very much for this nice addition to detekt. 🙏

private val subject = PropertyUsedBeforeDeclaration()

@Test
fun `used before declaration in getter`() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether other scenarios exist where a test case would be beneficial.
However, I couldn't come up with any scenarios, which you haven't already added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notable changes Marker for notable changes in the changelog rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if property is used before assignment
4 participants