tools: format source files in parallel

Signed-off-by: Marcel Cornu <marcel.d.cornu@intel.com>
This commit is contained in:
Marcel Cornu 2024-05-01 10:07:41 +01:00 committed by Pablo de Lara
parent 0231d314f5
commit 496255cda6

View File

@ -36,8 +36,11 @@ if [ $(clang_format_version) -ge $clang_format_min_version ]; then
echo "Formatting files using clang-format v$(clang_format_version)..."
for f in `git ls-files '*.[c|h]'`; do
[ "$verbose" -gt 0 ] && echo "formatting $f"
$clang_format -style=file -i "$f"
$clang_format -style=file -i "$f" &
done
else
echo "clang-format version ${clang_format_min_version}+ is required!"
fi
# wait for background processes to finish
wait