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

Rule: Require more than one statement per with block #42

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

artureiji
Copy link
Contributor

@artureiji artureiji commented Jun 13, 2024

FD-43685

Create a detektor validator for our styleguide rule for with blocks:

// Good
with(brandOrder.incomingPayment) {
  assertThat(state).isEqualTo(State.COMPLETE)
  assertThat(amountCents).isEqualTo(4_42L)
}

// Bad (only 1 action on the receiver)
with(brandOrder.incomingPayment) {
  assertThat(state).isEqualTo(State.COMPLETE)
}

Copy link
Collaborator

@Nava2 Nava2 left a comment

Choose a reason for hiding this comment

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

Nice! Nice and simple. 👍🏻

@Nava2 Nava2 changed the title create detektor for with block Rule: Require more than one statement per with block Jun 14, 2024
@Nava2 Nava2 merged commit fcffa06 into main Jun 14, 2024
3 checks passed
@Nava2 Nava2 deleted the artur.aciole/with-block-multiple-actions branch June 14, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants