diktat icon indicating copy to clipboard operation
diktat copied to clipboard

Indentation was removed after diktatFix was executed

Open xiaoqian0408 opened this issue 3 years ago • 3 comments

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

  • diktat version: 1.1.0
  • build tool (maven/gradle): gradle
  • how is diktat run (CLI, plugin, etc.): command line
  • kotlin version: 1.6.20
  • operating system: Mac and linux
  • link to a project (if your project is public):

xiaoqian0408 avatar Jun 13 '22 12:06 xiaoqian0408

Any thoughts here?

droidmatic34 avatar Jun 14 '22 01:06 droidmatic34

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.

petertrr avatar Jun 14 '22 09:06 petertrr

Please upgrade to latest version of diktat: 2.0.0

nulls avatar Dec 19 '23 11:12 nulls