Levi
11/20/2023, 8:51 PM--include-only
option?gammax
11/23/2023, 5:38 PM--include-only
flag to control which files you want ktfmt-gradle to format. That is particularly useful for pre-commit hooks where you don’t want to touch all the other files.Levi
11/23/2023, 5:43 PMgit diff --name-only --cached
and pass that to --include-only
precommit
gammax
11/23/2023, 5:46 PMLevi
11/23/2023, 5:47 PMYou can then invoke the task with --include-only and a comma separated list of relative path of files:but then the example is with a colon, not a comma:
./gradlew ktfmtPrecommit --include-only=src/main/java/File1.kt:src/main/java/File2.kt
gammax
12/02/2023, 12:49 AM