Skip to content

Commit

Permalink
Apply clang-format to the code base, add CI check
Browse files Browse the repository at this point in the history
  • Loading branch information
Neverlord committed Aug 3, 2022
1 parent 8b49a61 commit 7e11326
Show file tree
Hide file tree
Showing 155 changed files with 1,842 additions and 1,932 deletions.
73 changes: 26 additions & 47 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,62 +1,41 @@
---
AccessModifierOffset: -2
---
AccessModifierOffset: '-2'
AlignAfterOpenBracket: Align
AlignEscapedNewlines: Right
AlignOperands: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: All
AlwaysBreakTemplateDeclarations: 'Yes'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
FixNamespaceComments: true
ColumnLimit: '80'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
ConstructorInitializerIndentWidth: '2'
ContinuationIndentWidth: '2'
Cpp11BracedListStyle: 'true'
FixNamespaceComments: 'true'
IncludeBlocks: Preserve
IndentCaseLabels: true
IndentCaseLabels: 'true'
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
IndentWidth: '2'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Language: Cpp
MacroBlockBegin: "^BEGIN_STATE$|CAF_BEGIN_TYPE_ID_BLOCK"
MacroBlockEnd: "^END_STATE$|CAF_END_TYPE_ID_BLOCK"
MaxEmptyLinesToKeep: 1
MacroBlockBegin: ^BEGIN_STATE$|CAF_BEGIN_TYPE_ID_BLOCK
MacroBlockEnd: ^END_STATE$|CAF_END_TYPE_ID_BLOCK
MaxEmptyLinesToKeep: '1'
NamespaceIndentation: None
PenaltyBreakAssignment: 25
PenaltyBreakBeforeFirstCallParameter: 50
PenaltyReturnTypeOnItsOwnLine: 25
PenaltyBreakAssignment: '21'
PenaltyBreakBeforeFirstCallParameter: '60'
PenaltyReturnTypeOnItsOwnLine: '50'
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceAfterCStyleCast: 'true'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesBeforeTrailingComments: '1'
Standard: Cpp11
UseTab: Never

...
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [master]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
#
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v13.0.0'
hooks:
- id: clang-format
exclude: ^tests/benchmark/readerwriterqueue/
Loading

0 comments on commit 7e11326

Please sign in to comment.