X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=format-cpp;h=17275de77c7f4ee7f0d004cab9f94558e9f2c511;hb=20c4b46aee1a984bc558b483826c1078f24d35e9;hp=a610728f3c86e3fdb7e83238179b058e4a07e85e;hpb=e89902fd5ca43a5cd037b280d186fbe3b9787a83;p=lttng-tools.git diff --git a/format-cpp b/format-cpp index a610728f3..17275de77 100755 --- a/format-cpp +++ b/format-cpp @@ -38,7 +38,7 @@ format_cpp() { # shellcheck disable=SC2086 find "$root_dir" -path './src/vendor' -prune \ -o -type f \( -name '*\.h' -o -name '*\.hpp' -o -name '*\.c' -o -name '*\.cpp' \) \ - -not -path '*/\.*' -print0 | xargs -n1 -0 $formatter -i --style=file --fallback-style=none + -not -path '*/\.*' -print0 | xargs -P$(nproc) -n1 -0 $formatter -i --style=file --fallback-style=none } if [[ -n "$FORMATTER" ]]; then @@ -46,10 +46,10 @@ if [[ -n "$FORMATTER" ]]; then formatter=$FORMATTER elif command -v clang-format-$expected_formatter_major_version &> /dev/null; then # Try using the expected version of clang-format - formatter="clang-format-$expected_formatter_major_version -i" + formatter="clang-format-$expected_formatter_major_version" else # Try using `clang-format` as is - formatter='clang-format -i' + formatter='clang-format' fi # Try to format files