Skip to content

Commit 9a9aa37

Browse files
committed
Revise the formatting strategy.
1 parent eb92f62 commit 9a9aa37

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

yk_format_new_files.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
#!/bin/sh
22
#
3-
# Format any new files that we have added in our fork.
3+
# Format yk-specific folders.
4+
#
5+
# In the past we tried using git-clang-format against upstream LLVM. This
6+
# worked well until you do an upstream sync. Since upstream's changes are not
7+
# consistently formatted, it meant that CI would always fail.
8+
#
9+
# For now we just format folders that contain only new files that we've
10+
# introduced for Yk.
11+
#
12+
# This script must be run in the root of the repository.
413

514
set -e
615

7-
clang/tools/clang-format/git-clang-format origin/main
16+
YK_DIRS="./clang/test/Yk ./llvm/lib/Transforms/Yk ./llvm/include/llvm/Transforms/Yk"
17+
18+
for dir in ${YK_DIRS}; do
19+
find ${dir} -type f -iname '*.cpp' -or -iname '*.h' -or -iname '*.c' | \
20+
xargs ./build/bin/clang-format -i
21+
done

0 commit comments

Comments
 (0)