mirror of
https://github.com/jlengrand/detekt.git
synced 2026-03-10 08:11:23 +00:00
Enable UnnecessaryLet rule for detekt code base (#4024)
* Enable UnnecessaryLet rule for detekt code base * baseline parser does not work with new lines * replace let with private extension function to improve readability Co-authored-by: Markus Schwarz <post@markus-schwarz.net>
This commit is contained in:
@@ -116,7 +116,7 @@ class NestedBlockDepth(config: Config = Config.empty) : Rule(config) {
|
||||
private fun insideLambdaDo(lambdaArguments: List<KtLambdaArgument>, function: () -> Unit) {
|
||||
if (lambdaArguments.isNotEmpty()) {
|
||||
val lambdaArgument = lambdaArguments[0]
|
||||
lambdaArgument.getLambdaExpression()?.bodyExpression?.let {
|
||||
if (lambdaArgument.getLambdaExpression()?.bodyExpression != null) {
|
||||
function()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user