detekt icon indicating copy to clipboard operation
detekt copied to clipboard

Split `ExplicitItLambdaParameter` in two

Open BraisGabin opened this issue 2 years ago • 0 comments

Expected Behavior of the rule

ExplicitItLambdaParameter has two different responsabilities. One that it is not redundant on lambda with just one parameter and forbid parameters called it on lambda that have more than one parameter.

I think that we should split those two responsabilities in two different rules

Context

I like a rule that flags unnecessary it declarations but I want to be able to use it as a name for my lambda. An example is forEachIndexed { index, it-> }. If I'm OK with using it on forEach the indexed shouldn't change that.

For that reason I want to split this rule. To enable one and disable the other.

BraisGabin avatar Apr 13 '24 10:04 BraisGabin