pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.06k stars 504 forks source link

standard:kdoc - A KDoc is not allowed inside 'value_argument_list' #2656

Closed vanniktech closed 1 month ago

vanniktech commented 1 month ago

The following enum entry gets flagged with 1.2.1:

      /** Planks. */
      Exercise(
        ...
      )

Why isn't kdoc allowed on an individual enum entry?

paul-dingemans commented 1 month ago

Please share a more complete code example and your .editorconfig that reproduces finding above.

Examples below are accepted by Ktlint without warnings:

enum class FooBar {
    /** Some foo */
    FOO,

    /** some bar */
    BAR
}

enum class FooBar2(s: String) {
    /** Some foo */
    FOO("aa"),

    /** Some bar */
    BAR("bb")
}

with .editorconfig:

root = true

[*.{kt,kts}]
ktlint_code_style = ktlint_official
ktlint_standard = enabled
ktlint_experimental = enabled
paul-dingemans commented 1 month ago

Closed due to lack of response.