Skip to content

Commit 5d37bc1

Browse files
chore: improve formatter performance
1 parent 427df35 commit 5d37bc1

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scripts/fast-format

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
set -euo pipefail
44

5+
echo "Script started with $# arguments"
6+
echo "Arguments: $*"
7+
echo "Script location: $(dirname "$0")"
8+
59
cd "$(dirname "$0")/.."
10+
echo "Changed to directory: $(pwd)"
611

712
if [ $# -eq 0 ]; then
813
echo "Usage: $0 <file-with-paths> [additional-formatter-args...]"
@@ -12,6 +17,8 @@ fi
1217

1318
FILE_LIST="$1"
1419

20+
echo "Looking for file: $FILE_LIST"
21+
1522
if [ ! -f "$FILE_LIST" ]; then
1623
echo "Error: File '$FILE_LIST' not found"
1724
exit 1
@@ -23,9 +30,9 @@ if ! command -v ktfmt-fast-format &> /dev/null; then
2330
fi
2431

2532
# Process Kotlin files
26-
kt_files=$(grep -E '\.kt$' "$FILE_LIST" | grep -v './buildSrc/build/')
27-
kt_files=$(grep -E '\.kt$' "$FILE_LIST" | grep -v './buildSrc/build/')
28-
echo "==> Found $(echo "$kt_files" | wc -l) Kotlin files:"
33+
echo "==> Looking for Kotlin files"
34+
kt_files=$(grep -E '\.kt$' "$FILE_LIST" | grep -v './buildSrc/build/' || true)
35+
echo "==> Done looking for Kotlin files"
2936

3037
if [[ -n "$kt_files" ]]; then
3138
echo "==> will format Kotlin files"

0 commit comments

Comments
 (0)