Skip to content

Commit

Permalink
build: add clang-format shell script (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
lqxhub authored May 7, 2023
1 parent cbeff34 commit 8c0be03
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions format_code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

find include src pika-tools -regex '.*\.\(cpp\|hpp\|c\|h\|cc\)' | xargs clang-format -i


# If you want to automatically format your code before git commit
# append the code to .git/hooks/pre-commit
#
# for FILE in $(git diff --cached --name-only | grep -E '.*\.(cpp|hpp|c|h|cc)')
# do
# if [[ "$FILE" =~ .*.(cpp|hpp|c|h)$ ]];then
# clang-format -i $FILE
# fi
# done

0 comments on commit 8c0be03

Please sign in to comment.