Skip to content

Commit

Permalink
make format run in parallel (#1080)
Browse files Browse the repository at this point in the history
  • Loading branch information
pca006132 authored Nov 29, 2024
1 parent ddc0a18 commit 11387fb
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@ if [ -z "$CLANG_FORMAT" ]; then
CLANG_FORMAT=clang-format
fi

$CLANG_FORMAT -i extras/*.cpp
$CLANG_FORMAT -i samples/*/*.{h,cpp}
$CLANG_FORMAT -i test/*.{h,cpp}
$CLANG_FORMAT -i bindings/*/*.cpp
$CLANG_FORMAT -i bindings/c/include/manifold/*.h
$CLANG_FORMAT -i bindings/wasm/*.{js,ts}
$CLANG_FORMAT -i bindings/wasm/examples/*.{js,ts,html}
$CLANG_FORMAT -i bindings/wasm/examples/public/*.{js,ts}
$CLANG_FORMAT -i src/*.{h,cpp}
$CLANG_FORMAT -i src/*/*.cpp
$CLANG_FORMAT -i include/manifold/*.h
$CLANG_FORMAT -i extras/*.cpp &
$CLANG_FORMAT -i samples/*/*.{h,cpp} &
$CLANG_FORMAT -i test/*.{h,cpp} &
$CLANG_FORMAT -i bindings/*/*.cpp &
$CLANG_FORMAT -i bindings/c/include/manifold/*.h &
$CLANG_FORMAT -i bindings/wasm/*.{js,ts} &
$CLANG_FORMAT -i bindings/wasm/examples/*.{js,ts,html} &
$CLANG_FORMAT -i bindings/wasm/examples/public/*.{js,ts} &
$CLANG_FORMAT -i src/*.{h,cpp} &
$CLANG_FORMAT -i src/*/*.cpp &
$CLANG_FORMAT -i include/manifold/*.h &

black bindings/python/examples/*.py
black --quiet bindings/python/examples/*.py &

for pattern in 'CMakeLists.txt' '*.cmake*'; do
for f in $(find -name ${pattern}); do
# skip build directories
if [[ $f != *build* && $f != *node_modules* ]]; then
gersemi -i $f
gersemi --no-warn-about-unknown-commands -i $f &
fi
done
done

wait

0 comments on commit 11387fb

Please sign in to comment.