scripts: Speed up uncrustify by running 4 jobs in parallel

There are some large files, and in most setups (including CI runners) we
have multiple cores available. Use xargs to run multiple parallel
uncrustify jobs rather than one large one. Just hardcode 4 jobs and 4
files at the same time for now.
This commit is contained in:
Benjamin Berg 2020-09-29 11:13:55 +02:00
parent 2d7f2c67bf
commit ffd30bd3d0

View file

@ -12,8 +12,11 @@ case "$1" in
;;
esac
ARGS=4
JOBS=4
pushd "$SRCROOT"
uncrustify -c "$CFG" $OPTS `git ls-tree --name-only -r HEAD | grep -E '.*\.[ch]$' | grep -v nbis | grep -v fpi-byte | grep -v build/`
git ls-tree --name-only -r HEAD | grep -E '.*\.[ch]$' | grep -v nbis | grep -v fpi-byte | grep -v build/ | xargs -n$ARGS -P $JOBS uncrustify -c "$CFG" $OPTS
RES=$?
popd
exit $RES
exit $RES