From 8894f8d0a1b7e554e7d0b194d15f9f56e7a7d581 Mon Sep 17 00:00:00 2001 From: Ramiro Leal-Cavazos Date: Mon, 29 Jan 2024 23:57:21 +0000 Subject: [PATCH] Add clang-format check to CI This PR adds a check to the CI right after checking out the Torch-MLIR repository to make sure that the changes in the PR don't require any `git clang-format` modifications. --- .github/workflows/lint.yml | 5 +++++ lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 464ebdad93c00..a4c476e17eb5f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,6 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: submodules: true - name: Validate GitHub Actions yaml files run: | yamllint ./.github/workflows/ ./.github/actions/ + + - name: Check clang-format + run: | + ./externals/llvm-project/clang/tools/clang-format/git-clang-format origin/main --diff diff --git a/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp b/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp index d1794de930b4e..8a64107b33940 100644 --- a/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp +++ b/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp @@ -46,7 +46,7 @@ static bool isNoneOrFloatDtype(MLIRContext *context, Value dtype) { static Type computeReductionType(PatternRewriter &rewriter, Operation *op, BaseTensorType tensorType, Value dim, bool keepDim) { - SmallVector sizes; + SmallVector sizes; int64_t dimInt; if (tensorType.hasSizes()) { ArrayRef inputShape = tensorType.getSizes();