From 1b267125957cb74f6d5c89f0ac5ebf46a141d549 Mon Sep 17 00:00:00 2001 From: Sergey Morozov Date: Thu, 22 Feb 2024 19:00:12 +0300 Subject: [PATCH] [chore] clang-format CI check replaced with pre-commit hook using clang-format. --- .github/workflows/build.yaml | 14 +++++++------- .pre-commit-config.yaml | 7 +++++++ 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2e531d15da..2e911bd10a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -213,10 +213,10 @@ jobs: clang-format: runs-on: ubuntu-latest steps: - - name: Checkout KLEE Code - uses: actions/checkout@v2 - - name: Run clang-format on KLEE Code - uses: jidicula/clang-format-action@v4.10.2 - with: - clang-format-version: '13' - include-regex: '(^.*\.((((c|C)(c|pp|xx|\+\+)?$)|((h|H)h?(pp|xx|\+\+)?$))|((ino|pde|proto|cu))$)|^(include|lib)\/.*\.inc)$' + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - uses: pre-commit/action@v3.0.1 + - uses: pre-commit-ci/lite-action@v1.0.2 + if: always() diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..be6def773b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +files: '(^.*\.((((c|C)(c|pp|xx|\+\+)?$)|((h|H)h?(pp|xx|\+\+)?$))|((ino|pde|proto|cu))$)|^(include|lib)\/.*\.inc)$' + +repos: +- repo: https://github.com/pre-commit/mirrors-clang-format + rev: v13.0.1 + hooks: + - id: clang-format