saveourtool / diktat

Strict coding standard for Kotlin and a custom set of rules for detecting code smells, code style issues and bugs
https://diktat.saveourtool.com
MIT License
537 stars 39 forks source link

Generates duplicate `@property` for parameter with `'` in name #1719

Closed nulls closed 10 months ago

nulls commented 1 year ago

Describe the bug

Generates duplicate @property for parameter with ``` in name

Expected behavior

Doesn't generate duplicate @property for parameter with ``` in name

Observed behavior

Steps to Reproduce

@file:Suppress("TYPE_ALIAS")

package com.saveourtool.osv4k.jackson

import kotlin.reflect.KClass

/**
 * @property using
 * @property contentUsing
 * @property keyUsing
 * @property nullsUsing
 * @property `as`
 * @property keyAs
 * @property contentAs
 * @property typing
 * @property converter
 * @property contentConverter
 * @property include
 * @property `as`
 */
@Suppress("LongParameterList")
actual annotation class JsonSerialize(
    actual val using: KClass<out JsonSerializer<out Any>>,
    actual val contentUsing: KClass<out JsonSerializer<out Any>>,
    actual val keyUsing: KClass<out JsonSerializer<out Any>>,
    actual val nullsUsing: KClass<out JsonSerializer<out Any>>,
    actual val `as`: KClass<*>,
    actual val keyAs: KClass<*>,
    actual val contentAs: KClass<*>,
    actual val typing: JsonSerializeTyping,
    actual val converter: KClass<out Converter<Any, Any>>,
    actual val contentConverter: KClass<out Converter<Any, Any>>,
    actual val include: JsonSerializeInclusion,
)
actual enum class JsonSerializeTyping {
    DEFAULT_TYPING,
    ;
}
actual enum class JsonSerializeInclusion {
    DEFAULT_INCLUSION,
    ;
}

Environment information

nulls commented 1 year ago

Probably incorrectly validated name "as" != "'as'"