-
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
Fixing WRONG_NEWLINES
rule with diktatFix does not set correct indents when WRONG_INDENTATION
rule is disabled
#1323
Comments
We also see that IntelliJ IDEA has changed a behaviour again. Previously we had implemented special flag to reproduce it's behaviour (extendedIndentAfterOperators). But now it is changed again, looks like they have fixed equals, but haven't fixed primitive operators for IDE this is ok: 5 +
7 + // <- 8 spaces (2 tab indents)
8 BUT the equal assignment in methods is working differently, even keeping in mind that it is an operator statement in AST: fun foo() =
println() // <- 4 spaces (1 tab indent)
Our |
@0x6675636b796f75676974687562 pls make the logic similar to IDEA |
WRONG_NEWLINES
rule with diktatFix does not set correct idents when WRONG_INDENTATION
rule is disabled
@akuleshov7, the lack of continuation indent in your 2nd example (despite IDEA's code style flags are:
both are on by default as per the Kotlin code style guidelines. |
WRONG_NEWLINES
rule with diktatFix does not set correct idents when WRONG_INDENTATION
rule is disabledWRONG_NEWLINES
rule with diktatFix does not set correct indents when WRONG_INDENTATION
rule is disabled
I had to disable
WRONG_INDENTATION
rule because it still behaves unexpectedly. Please reopen #1312I can imagine that it is correct behavior that auto correct
WRONG_NEWLINES
rule does not set the indents correctly (2 instead of 4) whenWRONG_INDENTATION
is disabled. Is there a correlation?But anyway, there is still a strange behavior with
WRONG_INDENTATION
. For example Ktlint online does not report anyWRONG_INDENTATION
warnings while it does locally. Also checking the fix checkbox does fix theWRONG_NEWLINES
properly, even with my config uploaded. But I'm pretty sure Ktlint online is buggy and does not respect the uploaded config file. It reportsMAGIC_NUMBER
, although I have disabled it in my config file.When I enable
WRONG_INDENTATION
the indents are set properly forWRONG_NEWLINES
when running diktatFix but then wrong indents are set at other places in the codebase. For example:becomes
The text was updated successfully, but these errors were encountered: