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 newlines between two consecutive }} after first run of diktat #407

Closed
petertrr opened this issue Oct 15, 2020 · 1 comment · Fixed by #463
Closed

No newlines between two consecutive }} after first run of diktat #407

petertrr opened this issue Oct 15, 2020 · 1 comment · Fixed by #463
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@petertrr
Copy link
Member

The code

when (node.elementType) {
            CLASS, FUN, PRIMARY_CONSTRUCTOR, SECONDARY_CONSTRUCTOR -> checkAnnotation(node)
}

is being fixed to

when (node.elementType) {
            CLASS, FUN, PRIMARY_CONSTRUCTOR, SECONDARY_CONSTRUCTOR -> checkAnnotation(node)

            else -> {
                // this is a generated else block
            }}

even though there should be a newline before the lase }

@petertrr petertrr added the bug Something isn't working label Oct 15, 2020
@orchestr7 orchestr7 added the help wanted Extra attention is needed label Oct 19, 2020
@petertrr petertrr self-assigned this Oct 27, 2020
@petertrr
Copy link
Member Author

This is actually not NewlinesRule but rather BlockStructureBraces rule. It's placed higher in rule set provider that WhenMustHaveElse. The code in the example is correctly fixed in diktat on the second run.

@petertrr petertrr changed the title NewlinesRule doesn't fix two consecutive }} No newlines between two consecutive }} after first run of diktat Oct 27, 2020
petertrr added a commit that referenced this issue Oct 27, 2020
### What's done:
* Rearranged rules in DiktatRuleSetProvider
petertrr added a commit that referenced this issue Oct 27, 2020
### What's done:
* Code style
petertrr added a commit that referenced this issue Oct 29, 2020
…rect mode (#463)

### What's done:
* Rearranged rules in DiktatRuleSetProvider
* Code style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants