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

Empty lines in class constructor before properties with comments #1889

Open
DrAlexD opened this issue Dec 21, 2023 · 0 comments
Open

Empty lines in class constructor before properties with comments #1889

DrAlexD opened this issue Dec 21, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@DrAlexD
Copy link
Member

DrAlexD commented Dec 21, 2023

Describe the bug

It looks like BLANK_LINE_BETWEEN_PROPERTIES rule also applies to class constructor. And it happens only for KDoc comments.

Expected behavior

/**
 * @property name single-line comment
 * @property birthDate
 *   kdoc property
 *   comment
 */
class B<K : Any> constructor(
    val name: String,
    /*
     * block
     * comment
     */
    private val lastName: String,
    val birthDate: String,
    /**
     * @property addr property
     * comment
     */
    val addr: String
) {}

Observed behavior

/**
 * @property name single-line comment
 * @property birthDate
 *   kdoc property
 *   comment
 */
class B<K : Any> constructor(
    val name: String,
    /*
     * block
     * comment
     */
    private val lastName: String,
    
    val birthDate: String,

    /**
     * @property addr property
     * comment
     */
    val addr: String
) {}

Steps to Reproduce

class B<K : Any> constructor(
    // single-line comment
    val name: String,
    /*
     * block
     * comment
     */
    private val lastName: String,
    /**
     * kdoc property
     * comment
     */
    val birthDate: String,
    /**
     * @property addr property
     * comment
     */
    val addr: String
) {}
@DrAlexD DrAlexD added the bug Something isn't working label Dec 21, 2023
@DrAlexD DrAlexD changed the title Empty lines in constructor before properties with comments Empty lines in class constructor before properties with comments Dec 21, 2023
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

No branches or pull requests

2 participants