Skip to content

Commit

Permalink
Move clang-format checks to pre-commit
Browse files Browse the repository at this point in the history
This will make them significantly easier for users to use, as well as
easier to migrate to future versions.
  • Loading branch information
stephenswat committed Nov 27, 2024
1 parent 99a341e commit 942cd8f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 50 deletions.
46 changes: 0 additions & 46 deletions .github/check_format.sh

This file was deleted.

21 changes: 17 additions & 4 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@ on:
jobs:
format:
runs-on: ubuntu-latest
container: ghcr.io/acts-project/format10:v11
env:
PRE_COMMIT_HOME: '/tmp/pre-commit'

steps:
- uses: actions/checkout@v3
- name: Check
run: .github/check_format.sh .
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/cache@v4
with:
path: |
${{ env.PRE_COMMIT_HOME }}
key: ${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v10.0.1
hooks:
- id: clang-format
types_or: [file]
files: \.(cpp|hpp|ipp|cu|cuh|sycl|hip)$

0 comments on commit 942cd8f

Please sign in to comment.