Skip to content

Commit 84cfdc1

Browse files
committed
split files into batches
1 parent 77c82e0 commit 84cfdc1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/githooks/check-file-format.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ function main-invocation() {
6666
method=--via-docker
6767
fi
6868

69-
dry_run_opt="${dry_run_opt:-}" scripts/githooks/check-file-format.sh "$method" $(list-files-to-check--"$check")
69+
list-files-to-check--"$check" |
70+
# Maximum size of command line and environment combined is typically
71+
# 2MB on Linux but only 256KB on macOS. Assume a maximum filename
72+
# length of 200 characters and limiting us to batches of 1000 files
73+
# gives us a bit of a safety margin.
74+
dry_run_opt="${dry_run_opt:-}" xargs --max-args=1000 scripts/githooks/check-file-format.sh "$method"
7075
}
7176

7277
# Run editorconfig natively.

0 commit comments

Comments
 (0)