https://kotlinlang.org logo
#ktlint
Title
g

GurpreetSK

09/17/2019, 3:52 PM
Hey! Is it possible to run ktlint only on a given set of files? Eg: Something like
./gradlew ktlint {list of files}
?
Context: I want to write a pre-receive git hook which runs ktlint task on all the changed files (only the changed files) and fail if the task fails.
a

adam-mcneilly

09/17/2019, 4:05 PM
I got it from this plugin, that had it as a helper task: https://github.com/JLLeitschuh/ktlint-gradle#additional-helper-tasks
👍 2
g

GurpreetSK

09/17/2019, 5:59 PM
You sir, saved me today! Thanks
439 Views