saveourtool / diktat

Strict coding standard for Kotlin and a custom set of rules for detecting code smells, code style issues and bugs
https://diktat.saveourtool.com
MIT License
521 stars 39 forks source link

Indentation was removed after diktatFix was executed #1359

Open xiaoqian0408 opened 2 years ago

xiaoqian0408 commented 2 years ago

After diktatFix, indentation was removed from a block of my kotlin code, please see screenshot here Screen Shot 2022-06-13 at 8 51 51 AM

Steps to Reproduce

I just ran ./gradlew clean diktatFix

Environment information

droidmatic34 commented 2 years ago

Any thoughts here?

petertrr commented 2 years ago

Hi @xiaoqian0408, thanks for your report! Unfortunately, I'm not able to reproduce this error with the code you've provided. Could you please check if the error can be reproduced on https://ktlint-demo.herokuapp.com and share the reproducer?

Also, looking at how start = if (icon == null) 12.dp else 16.dp statement has been fixed, I suspect that you may be using an older version of diktat, because after https://github.com/saveourtool/diktat/commit/e8b4a51183ed2814eaeca8c764dd54a203c6f3cb we don't wrap single statements in run anymore, even though it was the case before version 1.1.0.

nulls commented 9 months ago

Please upgrade to latest version of diktat: 2.0.0