aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/lint.yml
blob: b906fac275a5ab7eb5050a90b832e9ba47088733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: lint

on:
  pull_request:
    paths:
      - '**.h'
      - '**.cc'

permissions:
  contents: read

jobs:
  format_code:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - name: Install clang-format
      uses: aminya/setup-cpp@v1
      with:
        clangformat: 17.0.5

    - name: Run clang-format
      run: |
        find include src -name '*.h' -o -name '*.cc' |  xargs clang-format -i -style=file -fallback-style=none
        git diff --exit-code