Files
coco 723ce1af5c a
2026-07-03 15:12:48 +08:00

13 lines
321 B
Bash

#!/bin/bash
# Fetch changed and untracked Kotlin files
CHANGED_FILES=$(git diff --name-only HEAD | grep '\.kt[s]*$' | tr '\n' ',')
if [ -z "$CHANGED_FILES" ]; then
echo "No Kotlin files have changed."
exit 0
fi
# Run detektFormat only on those files
./gradlew detektFormat -Ddetekt.filesToCheck=$CHANGED_FILES