From d35764e4c30446390fed4fef1a6e89bce316a275 Mon Sep 17 00:00:00 2001 From: Paul Koch Date: Sat, 27 Jul 2024 10:45:12 -0700 Subject: [PATCH] check formatting --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dafb3bf85..013a8feba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -479,3 +479,30 @@ jobs: flags: bdist_${{ matrix.name }} name: codecov_bdist_${{ matrix.name }} token: ${{ secrets.CODECOV_TOKEN }} + + format_clang: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v4 + - name: Check C++ code formatting with clang-format + continue-on-error: true + run: | + echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee /etc/apt/sources.list.d/llvm-toolchain-jammy-16.list + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg + sudo apt --yes update + sudo apt --yes install clang-format-16 + find shared/libebm \( -iname "*.cpp" -o -iname "*.h" -o -iname "*.hpp" \) | xargs clang-format-16 -i -style=file + git diff --exit-code + + format_black: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v4 + - name: Check python matches black format + continue-on-error: true + run: | + cd python/interpret-core + python -m pip install --upgrade black + black --check .