Skip to content

Commit

Permalink
[CI] Enable clang-format check
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhsieh-intel committed Oct 23, 2024
1 parent e3402a9 commit e9caa17
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ env:
PARALLEL: -j 2

jobs:
format-checks:
runs-on: ubuntu-latest
name: clang-format check
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: '3.10'
cache: 'pip'
- name: Install pre-commit
run: pip install pre-commit
- name: Run clang-format check
run: pre-commit run --all-files --show-diff-on-failure --color always
unit-tests:
runs-on: ubuntu-latest
# One runner for each domain
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.0
hooks:
- id: clang-format
files: \.(c|cxx|cpp|h|hxx|hpp)$
exclude: ^deps/

0 comments on commit e9caa17

Please sign in to comment.