Join Slack
Powered by
Hey! Is it possible to run ktlint only on a given ...
# ktlint
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}
?
GurpreetSK
09/17/2019, 3:56 PM
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
Yeah! Check out this hook:
https://github.com/AdamMc331/PokeDex/blob/master/scripts/git-hooks/pre-commit.sh
🎉 1
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
1757
Views
Open in Slack
Previous
Next