Skip to content

Commit

Permalink
chore: simplify exit
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-liang3 committed Jan 23, 2025
1 parent 01c97de commit ba2d82f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions tools/development/helpers/check-format-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ project_directory="$(git rev-parse --show-toplevel)"

pushd "${project_directory}" > /dev/null

clang-format -Werror --dry-run -style=file:thirdparty/clang/.clang-format $(find ~+ src/ include/ test/ bindings/python/src/ -name '*.cpp' -o -name '*.cxx' -o -name '*.hpp' -o -name '*.tpp')
clang-format -Werror --dry-run -style=file:thirdparty/clang/.clang-format $(find ~+ src/ include/ test/ bindings/python/src/ -name '*.cpp' -o -name '*.cxx' -o -name '*.hpp' -o -name '*.tpp') \
|| exit 1

eval "popd > /dev/null; exit $?" # eval so $? is still the exit code of clang-format rather than popd
popd > /dev/null
5 changes: 3 additions & 2 deletions tools/development/helpers/check-format-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ project_directory="$(git rev-parse --show-toplevel)"

pushd "${project_directory}" > /dev/null

python${OSTK_PYTHON_VERSION} -m black --check --diff bindings/python/
python${OSTK_PYTHON_VERSION} -m black --check --diff bindings/python/ \
|| exit 1

eval "popd > /dev/null; exit $?" # eval so $? is still the exit code of python rather than popd
popd > /dev/null
5 changes: 3 additions & 2 deletions tools/development/helpers/format-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ project_directory="$(git rev-parse --show-toplevel)"

pushd "${project_directory}" > /dev/null

clang-format -i -style=file:thirdparty/clang/.clang-format $(find ~+ src/ include/ test/ bindings/python/src/ -name '*.cpp' -o -name '*.cxx' -o -name '*.hpp' -o -name '*.tpp')
clang-format -i -style=file:thirdparty/clang/.clang-format $(find ~+ src/ include/ test/ bindings/python/src/ -name '*.cpp' -o -name '*.cxx' -o -name '*.hpp' -o -name '*.tpp') \
|| exit 1

eval "popd > /dev/null; exit $?" # eval so $? is still the exit code of clang-format rather than popd
popd > /dev/null
5 changes: 3 additions & 2 deletions tools/development/helpers/format-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ project_directory="$(git rev-parse --show-toplevel)"

pushd "${project_directory}" > /dev/null

python${OSTK_PYTHON_VERSION} -m black bindings/python/
python${OSTK_PYTHON_VERSION} -m black bindings/python/ \
|| exit 1

eval "popd > /dev/null; exit $?" # eval so $? is still the exit code of python rather than popd
popd > /dev/null
5 changes: 3 additions & 2 deletions tools/development/helpers/test-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ test_directory="${project_directory}/bindings/python/test"

pushd "${test_directory}" > /dev/null

python${OSTK_PYTHON_VERSION} -m pytest -sv ${@}
python${OSTK_PYTHON_VERSION} -m pytest -sv ${@} \
|| exit 1

eval "popd > /dev/null; exit $?" # eval so $? is still the exit code of python rather than popd
popd > /dev/null

0 comments on commit ba2d82f

Please sign in to comment.