Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Keep empty brace of companion object #600

Merged

Conversation

yukukotani
Copy link
Contributor

Fixes #411

keep empty brace of companion object from removing, because the removing causes compile error.

Current

class test {
    // Unnecessary block ("{}")
    companion object {}
    enum class ExampleEnum {
        EXAMPLE
    }
}

// Formatted
class test {
    companion object
    enum class ExampleEnum {
        // Compile error
        EXAMPLE
    }
}

Patched

class test {
    // No error
    companion object {}
    enum class ExampleEnum {
        EXAMPLE
    }
}

Copy link
Collaborator

@Tapchicoma Tapchicoma left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this!

@Tapchicoma Tapchicoma merged commit 3963a77 into pinterest:master Oct 3, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ktlint removes curly braces from empty companion object
2 participants