https://kotlinlang.org logo
#ktfmt
Title
j

Javier

12/24/2020, 4:35 PM
One question,
gradlew build
run check and/or format tasks?
g

gammax

12/24/2020, 4:36 PM
build
will run the
check
task, that will subsequently call all the
ktfmtCheck
task.
j

Javier

12/24/2020, 4:38 PM
nice, I can do this without breaking the parallel execution or cache? The idea is
gradlew build
fix the format automatically. I don’t know if could be interesting to have a flag about this in
ktfmt
block 🤔
Copy code
afterEvaluate {
    tasks.getByName("ktfmtCheck").dependsOn(tasks.getByName("ktfmtFormat"))
}
g

gammax

12/24/2020, 4:40 PM
What I usually do, I have a
reformatAll
task to reformat everything
I have to say that I’m not a big fan of having tasks that edit the code in the
build
task.
👍 1
2 Views