Skip to content

Commit

Permalink
Adds logic to fail if any check fails in check-formatting.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ilumsden committed Oct 17, 2024
1 parent ec10e7a commit 3bebe69
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/formatting/check-formatting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ cd ..

echo "Check formatting of C/C++ code in 'src'"
find src -name "*.c" -or -name "*.cpp" -or -name "*.h" -or -name "*.hpp" | xargs $clang_format_exe --dry-run -Werror
src_check_rc=$?

echo "Check formatting of C/C++ code in 'include'"
find include -name "*.c" -or -name "*.cpp" -or -name "*.h" -or -name "*.hpp" | xargs $clang_format_exe --dry-run -Werror
include_check_rc=$?

cd $curr_dir
cd $curr_dir

if [ $src_check_rc -ne 0 ] || [ $include_check_rc -ne 0 ]; then
exit 2
fi

0 comments on commit 3bebe69

Please sign in to comment.