ktlint is the most used linter for kotlin code. It is currently maintained by pinterest. it has integration with both maven and gradle.
Questions tagged [ktlint]
37 questions
0
votes
0 answers
ktlint with spotless custom rules
I have successfully integrated the ktlint with spotless plugin but now I need to trigger custom rules from spotless and unfortunately I coundn't find out any documentation about it, any help would be greatly appreciated.

Bytecode
- 6,551
- 16
- 54
- 101
0
votes
1 answer
Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilation is running on a JDK, not JRE
When I run ktlint ci, the following unknown error occurs.
enter image description here
I'm truly at a loss, would appreciate some help.
If any more information is needed let me know and I'll do my best to provide it.

유현명
- 1
- 1
0
votes
0 answers
I'm using Android CI (run ktlint with reviewdog) with github actions, but I can't check max line length
I want to get comments from reviewdog when my code exceeds 100 characters per line, but it doesn't work as expected
Here is my script
name: reviewdog
on: [pull_request]
jobs:
ktlint:
name: Check Code Quality
runs-on: ubuntu-latest
…

SungBeen Kim
- 1
- 1
0
votes
0 answers
Spotless + Ktlint : org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:spotlessKotlin'
When I run a spotlessKotlin task I get this error message.
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:spotlessKotlin'.
at…

Yosuke Sakurai
- 1
- 1
- 1
0
votes
1 answer
ktlint and KotlinProjectExtension
I tried to implement Kotlin check style in project using ktlint.
I added
plugins {
id("org.jlleitschuh.gradle.ktlint") version "10.1.0" apply false
}
in root build.gradle.kts and
plugins {
id("org.jlleitschuh.gradle.ktlint")
}
in…

Stitch
- 39
- 1
- 7
0
votes
2 answers
How to configure ktlint gradle plugin in a continuous mode?
In my Android Studio app project, I've integrated ktlint gradle.
Is it possible to configure the ktlint gradle plugin, so that it runs continuously on the fly (while coding on the keyboard)?? Like ESlint is used for JS, it warns me immediately if…

Ralf Wickum
- 2,850
- 9
- 55
- 103
0
votes
1 answer
How to install ktlint properly
I am trying to install to ktlint. I did it with the following line of code on present on their website
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.39.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
but when i…

Apoorv Srivastava
- 25
- 4