Closed adamsmd closed 10 months ago
The number of allowed extension function calls on a line does not seem to respect [WRONG_NEWLINES].maxCallsInOneLine.
[WRONG_NEWLINES].maxCallsInOneLine
In diktat.kt:
diktat.kt
- name: WRONG_NEWLINES configuration: maxParametersInOneLine: 100 maxCallsInOneLine: 100
Somewhere in your Kotlin code:
3.toInt().toInt().toInt().toInt()
(Granted, using toInt() repeatedly this way is dumb. This is just to make the example simple.)
toInt()
No warning from DiKTat.
DiKTat produces the following warning:
[WRONG_NEWLINES] incorrect line breaking: wrong split long `dot qualified expression` or `safe access expression` (diktat-ruleset:newlines)
This issue seems to be related to the use of a magic number instead of a configuration variable at the following, but I don't understand enough of the code to know if that number controls other things: https://github.com/saveourtool/diktat/blob/9c96ec43e36818a325bb43e4ef12ceffa838828a/diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter3/files/NewlinesRule.kt#L160
hi @adamsmd, thanks for raising the issue. We will look into it
Describe the bug
The number of allowed extension function calls on a line does not seem to respect
[WRONG_NEWLINES].maxCallsInOneLine
.Steps to Reproduce
In
diktat.kt
:Somewhere in your Kotlin code:
(Granted, using
toInt()
repeatedly this way is dumb. This is just to make the example simple.)Expected behavior
No warning from DiKTat.
Observed behavior
DiKTat produces the following warning:
Notes
This issue seems to be related to the use of a magic number instead of a configuration variable at the following, but I don't understand enough of the code to know if that number controls other things: https://github.com/saveourtool/diktat/blob/9c96ec43e36818a325bb43e4ef12ceffa838828a/diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter3/files/NewlinesRule.kt#L160
Environment information