Skip to content

Commit d863adb

Browse files
Add clang-format (#1677)
* Add clang-format rules * Update clang-format
1 parent 6bd94c2 commit d863adb

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.clang-format

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
BasedOnStyle: LLVM
3+
AlignAfterOpenBracket: BlockIndent
4+
BinPackArguments: true
5+
BinPackParameters: true
6+
BracedInitializerIndentWidth: 4
7+
ColumnLimit: 120
8+
Cpp11BracedListStyle: true
9+
IndentWidth: 4
10+
IndentWrappedFunctionNames: true
11+
PointerAlignment: Left
12+
SeparateDefinitionBlocks: Always
13+
Standard: c++17
14+
StatementMacros:
15+
- 'MAKE_PreconditionOptimizer32bit1State'
16+
- 'MAKE_PreconditionOptimizer32bit2State'
17+
- 'MAKE_PreconditionStatic8bit1State'
18+
- 'MAKE_PreconditionStatic8bit2State'
19+
- 'MAKE_Optimizer32bit1State'
20+
- 'MAKE_optimizerStatic8bit1State'
21+
- 'MAKE_optimizerStatic8bit2State'
22+
- 'MAKE_OptimizerStatic8bit1StateBlockwise'
23+
- 'MAKE_OptimizerStatic8bit2StateBlockwise'
24+
- 'MAKE_kQuantizeBlockwise'
25+
- 'MAKE_BLOCKWISE8'
26+
- 'MAKE_ELEMENTWISE_FUNC'
27+
- 'CMAKE_ELEMENTWISE_FUNC'
28+
- 'MAKE_FUNC8'
29+
- 'MAKE_FUNC32'
30+
- 'MAKE_CBLOCKWISE8'
31+
- 'MAKE_CFUNC8'
32+
- 'MAKE_CFUNC32'
33+
34+
UseTab: Never
35+
36+
...

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ repos:
2121
rev: v1.26.0
2222
hooks:
2323
- id: typos
24+
- repo: https://github.com/pre-commit/mirrors-clang-format
25+
rev: v20.1.6
26+
hooks:
27+
- id: clang-format
28+
types_or: [c++, c, cuda]
29+
files: ^csrc/

0 commit comments

Comments
 (0)