CI: Improve formatcode.sh efficiency

Batch files into clang-format to prevent needless processes. Now its
twice as fast in real time and uses 4x less resources. The old
implementation is also slower (but pretty close to) running a single
invocation of clang-format on all files.

before
time ./formatcode.sh
real	0m3.860s
user	0m20.975s
sys	0m6.694s

after
time ./formatcode.sh
real	0m1.486s
user	0m5.426s
sys	0m0.203s
master
Kurt Kartaltepe 2020-05-24 13:55:49 -07:00
parent e099fa8110
commit a7ebf47834
1 changed files with 1 additions and 1 deletions

View File

@ -35,4 +35,4 @@ find . -type d \( -path ./deps \
-o -path ./plugins/obs-outputs/ftl-sdk \
-o -path ./plugins/obs-vst \
-o -path ./build \) -prune -type f -o -name '*.h' -or -name '*.hpp' -or -name '*.m' -or -name '*.mm' -or -name '*.c' -or -name '*.cpp' \
| xargs -I{} -P ${NPROC} ${CLANG_FORMAT} -i -style=file -fallback-style=none {}
| xargs -L100 -P${NPROC} ${CLANG_FORMAT} -i -style=file -fallback-style=none