- Add this to your
~/.bash_profile
or~/.zshrc
. - Then regardles if the project is setup with
maven
orgradle
when you executekf
the right task is going to be executed
Last active
March 2, 2021 14:56
-
-
Save Panthro/a7dbcc44fb21532e178ca4c4bb010c7b to your computer and use it in GitHub Desktop.
Ktlint format that uses maven or gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function kf { | |
if [ -f pom.xml ]; then | |
echo "Using maven antrun" | |
./mvnw antrun:run@ktlint-format | |
else | |
echo "Using gradle" | |
./gradlew ktlintFormat | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you @Panthro !! Now part of my dotfiles :)