question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apply gradle task fail to fix Trailing spaces with ktlint

See original GitHub issue

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"

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
alouanemedcommented, Aug 6, 2018

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

image

0reactions
VihaanVerma89commented, Jun 22, 2020

I had similar issue with this code

    private fun bindTotalEarnings(
        holder: TotalEarningViewHolder, totalEarning:
        TotalEarning, position: Int
    ) {
        holder.titleTV.text = totalEarning.earning
    }

changing to below format fixed the error

    private fun bindTotalEarnings(
        holder: TotalEarningViewHolder,
        totalEarning: TotalEarning,
        position: Int
    ) {
        holder.titleTV.text = totalEarning.earning
    }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apply gradle task fail to fix Trailing spaces with ktlint
Apply gradle task fail to fix Trailing spaces with ktlint. ... When running spotlessCheck and later spotlessApply am getting this error
Read more >
Ktlint
Most lint violations don't need to be fixed manually. ktlint has a built-in formatter which fixes violations when possible. Some violations can not...
Read more >
android - Problems running ktlint from module - Stack Overflow
and run the task, I get this error: FAILURE: Build failed with an exception. What went wrong: Could not determine the dependencies of...
Read more >
Supported hooks - pre-commit
add -trailing-comma - Automatically add trailing commas to calls and literals. ... git-check - Use git to check for conflict markers and core.whitespace...
Read more >
jeremymailen / ktlint Download - JitPack
Add it in your root build.gradle at the end of repositories: ... No trailing whitespaces (id: no-trailing-spaces ); No Unit returns ( fun...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found