aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/lint.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/lint.yml')
-rw-r--r--.github/workflows/lint.yml26
1 files changed, 26 insertions, 0 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 00000000..b906fac2
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -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