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_BRACES_IN_CONDITIONALS_AND_LOOPS FP when when branch has comments and a single statement #585

Closed
petertrr opened this issue Nov 27, 2020 · 0 comments · Fixed by #591
Closed
Assignees
Labels
bug Something isn't working

Comments

@petertrr
Copy link
Member

Describe the bug

when (foo) {
    Bar -> {
        // this is Bar
        bar()
    }
    else -> {
    }
}

reports branch with Bar incorrect:
[NO_BRACES_IN_CONDITIONALS_AND_LOOPS] in if, else, when, for, do, and while statements braces should be used. Exception: single line if statement.: WHEN

Environment information

  • diktat version: 0.1.5
@petertrr petertrr added the bug Something isn't working label Nov 27, 2020
@petertrr petertrr self-assigned this Nov 30, 2020
petertrr added a commit that referenced this issue Nov 30, 2020
### What's done:
* Fixed logic
* Added test
petertrr added a commit that referenced this issue Nov 30, 2020
…n there is a comment in when entry (#591)

### What's done:
* Fixed logic
* Added test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant