Skip to content

Add PropertyUsedBeforeDeclaration rule#6062

Merged
cortinico merged 1 commit into
detekt:mainfrom
t-kameyama:issue_749
May 9, 2023
Merged

Add PropertyUsedBeforeDeclaration rule#6062
cortinico merged 1 commit into
detekt:mainfrom
t-kameyama:issue_749

Conversation

@t-kameyama
Copy link
Copy Markdown
Contributor

Fixes #749

@detekt-ci detekt-ci added the rules label May 1, 2023
@detekt-ci
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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