Skip to content

Commit

Permalink
Exclude target directory from format checks (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyfelder committed Oct 16, 2023
1 parent 028bed1 commit 1cf7b2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
status=0
# Run clang-format on CUDA, C, and CPP files
# clang-format writes to stderr in dry-run mode. In order to capture the output to detect if there are changes needed we redirect stderr to stdin
if [[ $(find ./ -path ./icicle/build -prune -iname *.h -or -iname *.cuh -or -iname *.cu -or -iname *.c -or -iname *.cpp | xargs clang-format --dry-run -ferror-limit=1 -style=file 2>&1) ]];
if [[ $(find ./ -path ./icicle/build -prune -o -path ./target -prune -iname *.h -or -iname *.cuh -or -iname *.cu -or -iname *.c -or -iname *.cpp | xargs clang-format --dry-run -ferror-limit=1 -style=file 2>&1) ]];
then
echo "🚨 There are files in Icicle Core that need formatting."
echo "Please format all .c, .cpp, .h, .cu, .cuh files using the following command:"
echo "find ./ -path ./icicle/build -prune -iname *.h -or -iname *.cuh -or -iname *.cu -or -iname *.c -or -iname *.cpp | xargs clang-format -i -style=file"
echo "find ./ -path ./icicle/build -prune -o -path ./target -prune -iname *.h -or -iname *.cuh -or -iname *.cu -or -iname *.c -or -iname *.cpp | xargs clang-format -i -style=file"
status=1
fi

Expand Down

0 comments on commit 1cf7b2e

Please sign in to comment.