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-blank-line-before-rbrace should not apply before class closing right brace #317

Closed
LtTempletonPeck opened this issue Nov 16, 2018 · 2 comments

Comments

@LtTempletonPeck
Copy link

#65 no-blank-line-before-rbrace should not apply when closing a class/object/enum/inteface etc

screenshot from 2018-11-16 13-06-56

RBrace.kt:6:1: Unexpected blank line(s) before "}" (no-blank-line-before-rbrace)

You can see in the above screenshot that the no-blank-line-before-rbrace before the class is closed this does not make sense and should be valid.

Can a change to the rule be applied?

@iamjoin7
Copy link

Agreed on this!

object GiveMeSomeBreathingSpace {

    fun lastFunction() {
        println("Can you breathe now?")
    }

}

Perhaps someone can help us write a custom rule for this?

I just found out about ktlint last week and I'm loving it (so thank you for all maintainers/contributors) but I really feel uncomfortable when the last function's closing bracket and the class's closing bracket has no newline between them. :)

@shyiko
Copy link
Collaborator

shyiko commented Feb 12, 2019

This rule is included in ktlint-standard-ruleset for "consistency reasons".
That being said, ability to disable rules on per-file basis is coming in #208.

@shyiko shyiko closed this as completed Feb 12, 2019
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

No branches or pull requests

3 participants