Skip to content

Empty lines in class constructor before properties with comments #1889

@DrAlexD

Description

@DrAlexD

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
) {}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions