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
516 stars 38 forks source link

`MAGIC_NUMBER` false positive when `Long` constants are used together with `kotlin.time.Duration` extensions #1934

Open 0x6675636b796f75676974687562 opened 2 weeks ago

0x6675636b796f75676974687562 commented 2 weeks ago

Describe the bug

The following constant declarations trigger the MAGIC_NUMBER false positive:

import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.seconds

val fooTimeout = 10L.seconds

val barTimeout = 10L.minutes

Environment information