3 # InsertBraces オプションに対応するため、clang-format-15 をインストールする
4 # そのため LLVM が用意している APT リポジトリを追加する
5 # 将来的に GitHub Actions の Ubuntu runner が 22.04 になれば Ubuntu の APT リポジトリからインストールできるかもしれない
6 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add - >/dev/null 2>&1
8 cat <<EOF | sudo tee /etc/apt/sources.list.d/llvm.list >/dev/null
9 deb http://apt.llvm.org/focal/ llvm-toolchain-focal main
10 deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal main
12 deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main
13 deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main
15 deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main
16 deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main
20 sudo apt-get update >/dev/null
21 sudo apt-get install clang-format-15 >/dev/null
23 SRC_FILES=$(find src/ -name \*.cpp -or -name \*.h)
25 clang-format-15 -style=file:.github/scripts/check-clang-format-style -i $SRC_FILES
30 if [ -s $DIFF_FILE ]; then
31 echo "Some source code files are not properly formatted."