summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2020-09-29 11:13:55 +0200
committerBenjamin Berg <bberg@redhat.com>2021-07-01 13:19:03 +0200
commite8f9cc1fcec16aa80c5ade81484ef4c8aab01464 (patch)
tree979d0dab34234a95ac48197939905abe3f0229e5 /scripts
parent0ee274946dd483787d4398257f233f0ea25a5c74 (diff)
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/uncrustify.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/uncrustify.sh b/scripts/uncrustify.sh
index cb03906..b912695 100755
--- a/scripts/uncrustify.sh
+++ b/scripts/uncrustify.sh
@@ -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 \ No newline at end of file
+exit $RES