https://kotlinlang.org logo
#detekt
Title
# detekt
k

kenkyee

01/02/2020, 6:28 PM
"are now configured to exclude the
**/test/**,**/*Test.kt,**/*Spec.kt"
folder (this is valid only if you were using the default config file)" ahh...FWIW, it was nicer having the excludes in one place since now it means you need to duplicate the excludes glob match list in a bunch of places. We did it for comments and these: - 'NamingRules' - 'WildcardImport' - 'MagicNumber' - 'MaxLineLength' - 'LateinitUsage' - 'StringLiteralDuplication' - 'SpreadOperator' - 'TooManyFunctions' - 'ForEachOnRange' - 'FunctionMaxLength' Looks like the default only does comments and: StringLiteralDuplication and TooManyFunctions
a

Artur Bosch

01/03/2020, 9:25 PM
Yep, it got a bit more verbose but is more flexible now and allow api-only rules for example. FYI
NamingRules
got deprecated in favor of the
naming
rule set.
excludes
and
includes
do work on the rule set level. In the long run when the scripting support of Kotlin gets a lot faster, we could introduce way to configure detekt with a kotlin script and get the compact wau to defines excludes back -
setOf("WildcardImport", ...).forEach { it.excludes("...") }
- 🙂
k

kenkyee

01/03/2020, 10:18 PM
sounds good...that would be nice 🙂
t

taso

01/06/2020, 2:02 PM
Just checked the default config in the repo, it looks like more of these are excluded for tests.
You can actually remove them completely from your config and enable the Gradle setting where it fallbacks to defaults
10 Views