Skip to content

Commit

Permalink
Merge pull request #27 from alandtse/clang
Browse files Browse the repository at this point in the history
ci: add clang format action
  • Loading branch information
doodlum authored Jul 17, 2023
2 parents 506869d + 53b3956 commit 171a0b6
Show file tree
Hide file tree
Showing 31 changed files with 2,376 additions and 2,469 deletions.
3 changes: 3 additions & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#ignore third party
./extern/*
./include/*
36 changes: 36 additions & 0 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run clang-format Linter

on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
format:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v3
with:
# check out HEAD on the branch
ref: ${{ github.head_ref }}
# make sure the parent commit is grabbed as well, because
# that's what will get formatted (i.e. the most recent commit)
fetch-depth: 2
# format the latest commit
- uses: DoozyX/[email protected]
with:
source: "."
exclude: "extern include"
extensions: "h,cpp,c,hlsl,hlsli"
clangFormatVersion: 16
inplace: True # commit the changes (if there are any)
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style: 🎨 apply clang-format changes"
branch: ${{ github.head_ref }}
Loading

0 comments on commit 171a0b6

Please sign in to comment.