From 6efc102c7e5a549cac14a35b3d76fc864623ad48 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Mon, 1 Jun 2020 19:14:19 -0700 Subject: [PATCH] Use clang-format 6.0 to check for code style (#15403, #15404) This way, the CI can run on the faster and more common Ubuntu machine. --- .github/workflows/codestyle.yml | 7 ++++--- tools/format-code.sh | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 9c7d6f95d..21d402e0a 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -5,13 +5,14 @@ on: [push, pull_request] jobs: codestyle: - runs-on: macos-latest + runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - - run: brew install clang-format + - run: sudo apt install -y clang-format-6.0 name: Install clang-format - - run: clang-format --version + - run: clang-format-6.0 --version - run: bash ./tools/format-code.sh name: Run code formatter + - run: git diff - run: git diff --quiet HEAD name: Check if the styling guide is followed diff --git a/tools/format-code.sh b/tools/format-code.sh index b88c5a093..f79756cc6 100755 --- a/tools/format-code.sh +++ b/tools/format-code.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash cwd=$(pwd) -clang-format -i --style=WebKit $cwd/src/*.h $cwd/src/*.cpp +clang-format-6.0 -i --style=WebKit $cwd/src/*.h $cwd/src/*.cpp