Skip to content

Commit abaa044

Browse files
author
Diptorup Deb
committed
Add clang-format config and update the Contribution doc.
1 parent fd63a3e commit abaa044

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.clang-format

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
BasedOnStyle: LLVM
2+
IndentWidth: 4
3+
AccessModifierOffset: -4
4+
AlignEscapedNewlines: Right
5+
AllowAllParametersOfDeclarationOnNextLine: false
6+
BinPackParameters: false
7+
BreakBeforeBraces: Custom
8+
BraceWrapping:
9+
AfterCaseLabel: true
10+
AfterClass: true
11+
AfterControlStatement: MultiLine
12+
AfterEnum: true
13+
AfterFunction: true
14+
AfterNamespace: true
15+
AfterObjCDeclaration: false
16+
AfterStruct: true
17+
AfterUnion: true
18+
AfterExternBlock: true
19+
BeforeCatch: false
20+
BeforeElse: true
21+
IndentBraces: false
22+
SplitEmptyFunction: true
23+
SplitEmptyRecord: true
24+
SplitEmptyNamespace: true
25+

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
## Source Code Formatting¶
44

5+
### C/C++ code style
6+
7+
We use [clang-format](https://clang.llvm.org/docs/ClangFormat.html) code formatter.
8+
9+
Install: `pip install clang`
10+
11+
- Revision: `10.0.1`
12+
- See the default configuration used by dpCtl in `.clang-format`.
13+
14+
Run before each commit: `clang-format -style=file -i dpctl-capi/include/*.h dpctl-capi/include/Support/*.h dpctl-capi/source/*.cpp dpctl-capi/tests/*.cpp dpctl-capi/helper/include/*.h dpctl-capi/helper/source/*.cpp`
15+
516
### Python code style
617

718

0 commit comments

Comments
 (0)