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

dimsuz

11/19/2021, 2:13 PM
We'd like to enable
NamedArguments
with
threshold=1
only for
Composable
functions, is there some analog of
ignoreAnnotated
which is in reverse: something like
onlyAnnotated
?
b

Brais Gabin

11/19/2021, 2:23 PM
There isn't right now. If we want to implement that maybe we could rename those too
excludeAnnotated
and
includeAnnotated
. Could you open an issue to track this? And if you can explain there a bit more of your use case would be great. cc @gammax I think that you talked about this before. It would great to be able to run the same rule multiple times with different configuration for cases like this. Run NamedArgument with threshold=1 if they are annotated with @Composable and set threshold=4 if they are not annotated with @Composable.
g

gammax

11/19/2021, 2:57 PM
Yeah we mentioned this in the past 🤔 Like you could have a
detekt.yaml
config and a
detekt-compose.yaml
config
d

dimsuz

11/19/2021, 2:59 PM
Run NamedArgument with threshold=1 if they are annotated with @Composable and set threshold=4 if they are not annotated with @Composable.
exactly this thought also crossed my mind, but then I thought this would be too complex to handle in a generic manner...
3 Views