-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WRONG_INDENTATION
: aligned chained method calls reported as false positives
#1336
Comments
0x6675636b796f75676974687562
changed the title
WRONG_INDENTATION: aligned chained method calls reported as false positives by the linter
Jun 1, 2022
WRONG_INDENTATION
: aligned chained method calls reported as false positives
A prerequisite for this is an expression-body function, i. e. none of the below will trigger the issue: val a = expression
val b =
expression
val c
get() =
expression
fun d() {
expression
} while this may: fun e() =
expression Minimal repro (assuming fun f() = first()
.second()
.third() // <- here, DiKTat suggest a double continuation indent (16) instead of a single continuation indent. At the same time, this fragment produces no warnings (which is correct): fun f() =
first() // Continuation indent
.second() // Double continuation indent
.third() // Double continuation indent aligned Another minimal repro: fun f() = g(first()
.second() // DiKTat suggest an indentation of 12
.third() // DiKTat suggest an indentation of 20
.fourth()) // DiKTat suggest an indentation of 28 Similarly, this fragment produces no warnings (which is correct, too): fun f() = g(
first()
.second()
.third()
.fourth()) |
0x6675636b796f75676974687562
added a commit
that referenced
this issue
Jul 12, 2022
### What's done: * This fixes #1336
2 tasks
0x6675636b796f75676974687562
added a commit
that referenced
this issue
Jul 12, 2022
### What's done: * This fixes #1336
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider this code example:
Chained method calls in lines 6-7 are normally aligned (e. g.: IDEA does so). Yet, DiKTat reports this as an error, suggesting the following formatting.
extendedIndentBeforeDot
on (the default):— and
extendedIndentBeforeDot
off:The corresponding IDEA code style flag is
CONTINUATION_INDENT_FOR_CHAINED_CALLS
, on by default.The text was updated successfully, but these errors were encountered: