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

r4zzz4k

03/05/2020, 2:51 PM
Hey. I've looked through existing rules, seems that nothing covers number of parameters in contructors.
LongParameterList
is the nearest thing, but it covers only methods. I've tried to cover constructors there (https://github.com/r4zzz4k/detekt/commit/1cf853c), but
./gradlew check
finds issues with existing code after that (https://github.com/arturbosch/detekt/blob/521e968/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/CodeSmell.kt#L44-L51). So two questions: 1. Does this sound like a useful rule? In discussions over the Internet on argument count limit I mostly see costructors included. Checktyle, for example, also covers both methods and parameters (https://checkstyle.sourceforge.io/apidocs/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheck.html), PMD seems to agree on that (https://stackoverflow.com/q/56492868/2475207). 2. What's the flow for contributing rules which don't validate current code? Seems that
check
task completes successfully on the project itself. 3. Are there any general contribution guidelines described somewhere I've missed?
b

Brais Gabin

03/05/2020, 3:23 PM
If you have the rule working, create a PR. We can talk about it there. If
check
fails we will see what to do.
r

r4zzz4k

03/05/2020, 3:23 PM
Got it, thanks!
Okay, my bad, didn't check
.github
directory, now I see contribution guildelines. Not very obvious location, but it's a matter of habit I guess.
2 Views