Skip to content

Commit c33a56f

Browse files
committed
clang & cmake format config
1 parent b57941b commit c33a56f

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.clang-format

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
5+
ColumnLimit: 100
6+
IndentWidth: 4
7+
8+
AccessModifierOffset: -1
9+
AlignAfterOpenBracket: AlwaysBreak
10+
AllowShortFunctionsOnASingleLine: Empty
11+
BinPackArguments: false
12+
BinPackParameters: false
13+
BreakBeforeBinaryOperators: NonAssignment
14+
DerivePointerAlignment: false
15+
IncludeBlocks: Preserve
16+
IndentPPDirectives: BeforeHash
17+
PenaltyBreakAssignment: 21
18+
19+
SpaceBeforeParens: Custom
20+
SpaceBeforeParensOptions:
21+
AfterControlStatements: false
22+
AfterForeachMacros: false
23+
AfterFunctionDeclarationName: false
24+
AfterFunctionDefinitionName: false
25+
AfterIfMacros: false
26+
AfterOverloadedOperator: false
27+
AfterPlacementOperator: true
28+
AfterRequiresInClause: false
29+
AfterRequiresInExpression: false
30+
BeforeNonEmptyParentheses: false

.cmake-format.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
with section("format"): # noqa F821
2+
line_width = 100
3+
tab_size = 2
4+
command_case = "lower"
5+
max_subgroups_hwrap = 2
6+
max_pargs_hwrap = 4

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
- id: clang-format
2121
types_or: [c++, c]
2222
args:
23-
- --style=Google
23+
- --style=file
2424

2525
- repo: https://github.com/pre-commit/pre-commit-hooks
2626
rev: v5.0.0

0 commit comments

Comments
 (0)