Skip to content

Commit

Permalink
CI: add lint github workflow for running clang-format (fmtlib#3749)
Browse files Browse the repository at this point in the history
so that we can identify changes which do not confirm to the
clang-format rules.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
  • Loading branch information
tchaikov authored and happymonkey1 committed Apr 6, 2024
1 parent 9a9df49 commit aa30a23
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit aa30a23

Please sign in to comment.