Hello. For the <LongMethod> rule, has anyone ever ...
# detekt
m
Hello. For the LongMethod rule, has anyone ever proposed making it configurable such that the default threshold of
60
applies for non-
@Compose
code but for
@Compose
code only, the threshold can be bumped up? I've enabled this rule recently in my team's codebase and have received feedback that the threshold of
60
is a bit aggressive for
@Compose
code. So far, the only compromise solution I see is to dial up the threshold for all functions.
n
We ended up writing a custom
ComposeLongMethod
rule in our codebase to increase the threshold and use
ignoreAnnotated
for the regular
LongMethod
👀 1
b
https://github.com/detekt/detekt/pull/7263 this PR will allow you to do something like that. Have multiple instances of the same rule with different configurations.
❤️ 3
But it'll be released for 2.0. The solution provided by @Nicholas Doglio is the only option for 1.x.
m
That's a nice solution @Nicholas Doglio. Makes sense.
@Brais Gabin wonderful! Glad to see this coming to Detekt 2.0.
Thank you both for your replies 🙂
🫡 1