spotless: Apply gradle task fail to fix Trailing spaces with ktlint

If you are submitting a bug, please include the following:

When running spotlessCheck and later spotlessApply am getting this error

> ApiService.kt':
> Error on line: 82, column: 5
> Trailing space(s)
> java.lang.AssertionError: Error on line: 82, column: 5
> Trailing space(s)
>  at com.diffplug.spotless.kotlin.KtLintStep$State.lambda$createFormat$0(KtLintStep.java:114)
>  at com.sun.proxy.$Proxy89.invoke(Unknown Source)

I’m using square code style, so I have indentation of 2.

image

Even though I format the code and have trailing spaces on Android Studio disabled to remove any spaces.

Version id "com.diffplug.gradle.spotless" version "3.14.0"

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Thanks @jbduncan, I found it using the search bar.

image