Ryan Sang
04/13/2026, 5:47 PMstandard:kdoc. I have some violations around method parameters and init blocks, such as
/**
* Configured filter classes.
*
* If you write a new [ConnectionFilter] or [DataFilter], you'll need to add it to this list so it has a name.
*
* The logic below this `init` block is for bookkeeping and filter spec parsing.
*/
init {
...
}
or
internal val queue = Channel<T>(
capacity = maxSize,
/** [BufferOverflow.DROP_LATEST] is the actual behavior we want and have below, but adding to the channel
* reports success when the capacity is exceeded and that strategy is used. So we use this strategy and
* bypass the suspending behavior by using [Channel.offer] */
onBufferOverflow = BufferOverflow.SUSPEND,
)
Most violations I fix by converting to block comment or moving to the appropriate declaration. For the init block, I don't really want to move the information away from the init statement. For the parameter, the information is really more about the parameter rather than kdoc for queue itself, so moving to queue feels inappropriate. For both I could turn to block comments, losing the smart links to declarations inside intelliJ, but I'm slowly enabling more linting flags in a large codebase and trying to avoid "functionality" loss.
Any suggestions? Just eat the loss of smart links?