Skip to content

Commit a537fc8

Browse files
committed
use mirrors-clang-format for pre-commit check
also adds .clang-format and moves to clang-format-22
1 parent 1c0abc5 commit a537fc8

2 files changed

Lines changed: 44 additions & 2 deletions

File tree

.clang-format

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
BasedOnStyle: LLVM
2+
3+
AccessModifierOffset: -4
4+
5+
AlignConsecutiveMacros: true
6+
AlignConsecutiveBitFields: true
7+
AlignEscapedNewlines: Right
8+
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: Empty
11+
12+
AlwaysBreakTemplateDeclarations: Yes
13+
14+
BinPackParameters: false
15+
16+
BraceWrapping:
17+
AfterCaseLabel: true
18+
AfterClass: true
19+
AfterControlStatement: Never
20+
AfterEnum: true
21+
AfterFunction: true
22+
AfterNamespace: true
23+
AfterObjCDeclaration: false
24+
AfterStruct: true
25+
AfterUnion: true
26+
AfterExternBlock: true
27+
BeforeCatch: false
28+
BeforeElse: true
29+
BeforeLambdaBody: false
30+
BeforeWhile: false
31+
IndentBraces: false
32+
SplitEmptyFunction: true
33+
SplitEmptyRecord: true
34+
SplitEmptyNamespace: true
35+
BreakBeforeBraces: Custom
36+
37+
ColumnLimit: 80
38+
39+
IndentWidth: 4
40+
IndentWrappedFunctionNames: true
41+
42+
Standard: c++17

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ repos:
5151
- id: black
5252
exclude: "_vendored/conv_template.py"
5353

54-
- repo: https://github.com/pocc/pre-commit-hooks
55-
rev: v1.3.5
54+
- repo: https://github.com/pre-commit/mirrors-clang-format
55+
rev: v22.1.0
5656
hooks:
5757
- id: clang-format
5858
args: ["-i"]

0 commit comments

Comments
 (0)