Skip to content

Commit

Permalink
Merge pull request #48 from smithlabcode/clang-format
Browse files Browse the repository at this point in the history
Source formatting with clang-format
  • Loading branch information
andrewdavidsmith authored Jun 23, 2024
2 parents acecc27 + 6b951d4 commit 41067cc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BasedOnStyle: llvm
BreakBeforeBraces: Custom
BraceWrapping:
BeforeElse: true
IndentWrappedFunctionNames: false
20 changes: 20 additions & 0 deletions .github/workflows/source-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Source code format check

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:

jobs:
check-format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install -y clang-format
- name: Run clang-format
run: |
git $(ls-files '*.*pp') | xargs clang-format -n -Werror

0 comments on commit 41067cc

Please sign in to comment.