Skip to content

Commit

Permalink
Trying to integrate clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnikTobi committed Jul 22, 2024
1 parent 36a21da commit a6068ca
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
Language: Cpp

BasedOnStyle: Google
BreakBeforeBraces: Allman

ColumnLimit: 0

BreakBeforeBinaryOperators: None
AlignAfterOpenBracket: BlockIndent

BinPackArguments: false
BinPackParameters: false

AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false

SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterFunctionDeclarationName: true
AfterFunctionDefinitionName: true

UseTab: Never
SpaceBeforeAssignmentOperators: true

AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakAfterReturnType: All
AllowShortFunctionsOnASingleLine: Empty
AllowAllArgumentsOnNextLine: true
AllowShortBlocksOnASingleLine: true

IndentWidth: 4

AccessModifierOffset: 0
EmptyLineAfterAccessModifier: Leave
IndentAccessModifiers: true

AlignOperands: true

BreakBeforeTernaryOperators: true

MaxEmptyLinesToKeep: 3
---
19 changes: 19 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ env:

jobs:

check_formatting:

runs-on: ubuntu-latest

steps:

# Check out the repository (basically downloads the source code)
- uses: actions/checkout@v3

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format
- name: Call clang-format
run: find src/ -name \*.c -o -name \*.h -print0 | xargs -0 -n 1 clang-format -n --Werror -n --verbose



build_and_publish:

strategy:
Expand Down

0 comments on commit a6068ca

Please sign in to comment.