mirror of
https://github.com/jlengrand/detekt.git
synced 2026-03-10 08:11:23 +00:00
Use reference in fallback property delegate (#3982)
Co-authored-by: Markus Schwarz <post@markus-schwarz.net> Co-authored-by: Brais <braisgabin@gmail.com>
This commit is contained in:
@@ -40,30 +40,25 @@ class LongParameterList(config: Config = Config.empty) : Rule(config) {
|
||||
Debt.TWENTY_MINS
|
||||
)
|
||||
|
||||
@Suppress("unused")
|
||||
@Deprecated("Use `functionThreshold` and `constructorThreshold` instead")
|
||||
@Configuration("number of parameters required to trigger the rule")
|
||||
private val threshold: Int by config(DEFAULT_FUNCTION_THRESHOLD)
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@OptIn(UnstableApi::class)
|
||||
@Configuration("number of function parameters required to trigger the rule")
|
||||
private val functionThreshold: Int by configWithFallback(
|
||||
fallbackPropertyName = "threshold",
|
||||
defaultValue = DEFAULT_FUNCTION_THRESHOLD
|
||||
)
|
||||
private val functionThreshold: Int by configWithFallback(::threshold, DEFAULT_FUNCTION_THRESHOLD)
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@OptIn(UnstableApi::class)
|
||||
@Configuration("number of constructor parameters required to trigger the rule")
|
||||
private val constructorThreshold: Int by configWithFallback(
|
||||
fallbackPropertyName = "threshold",
|
||||
defaultValue = DEFAULT_CONSTRUCTOR_THRESHOLD
|
||||
)
|
||||
private val constructorThreshold: Int by configWithFallback(::threshold, DEFAULT_CONSTRUCTOR_THRESHOLD)
|
||||
|
||||
@Configuration("ignore parameters that have a default value")
|
||||
private val ignoreDefaultParameters: Boolean by config(defaultValue = false)
|
||||
private val ignoreDefaultParameters: Boolean by config(false)
|
||||
|
||||
@Configuration("ignore long constructor parameters list for data classes")
|
||||
private val ignoreDataClasses: Boolean by config(defaultValue = true)
|
||||
private val ignoreDataClasses: Boolean by config(true)
|
||||
|
||||
@Configuration(
|
||||
"ignore long parameters list for constructors, functions or their parameters in the " +
|
||||
|
||||
Reference in New Issue
Block a user