Skip to content

Commit 41067cc

Browse files
Merge pull request #48 from smithlabcode/clang-format
Source formatting with clang-format
2 parents acecc27 + 6b951d4 commit 41067cc

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.clang-format

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
BasedOnStyle: llvm
2+
BreakBeforeBraces: Custom
3+
BraceWrapping:
4+
BeforeElse: true
5+
IndentWrappedFunctionNames: false
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Source code format check
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
check-format:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
- name: Install dependencies
17+
run: sudo apt-get install -y clang-format
18+
- name: Run clang-format
19+
run: |
20+
git $(ls-files '*.*pp') | xargs clang-format -n -Werror

0 commit comments

Comments
 (0)