Skip to content

Commit b3d3c1d

Browse files
Added clang-format
1 parent 44a5b2f commit b3d3c1d

26 files changed

+2833
-2935
lines changed

.clang-format

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# Most of the settings are inherited by LLVM default
3+
BasedOnStyle: LLVM
4+
# Cpp covers both C and C++.
5+
Language: Cpp
6+
AlignConsecutiveAssignments: None
7+
AlignConsecutiveBitFields: Consecutive
8+
AlignConsecutiveMacros: Consecutive
9+
AlignEscapedNewlines: Left
10+
AllowAllArgumentsOnNextLine: false
11+
AllowAllParametersOfDeclarationOnNextLine: false
12+
AllowShortIfStatementsOnASingleLine: Never
13+
AllowShortFunctionsOnASingleLine: Inline
14+
AllowShortLoopsOnASingleLine: true
15+
AlwaysBreakBeforeMultilineStrings: true
16+
BinPackArguments: false
17+
BinPackParameters: false
18+
ColumnLimit: 100
19+
IndentCaseLabels: true
20+
# Most files have used this indentation width and to not get to large diffs
21+
# at the first adaption to clang the width is kept at 4 instead of the LLVM and
22+
# Google default of 2.
23+
IndentWidth: 4
24+
PointerAlignment: Left
25+
KeepEmptyLinesAtTheStartOfBlocks: false
26+
SpacesBeforeTrailingComments: 2
27+
Standard: Auto
28+
...

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
LINTER_RULES_PATH: /
2525
IGNORE_GITIGNORED_FILES: true
2626
VALIDATE_BASH: true
27+
VALIDATE_CLANG_FORMAT: true
2728
VALIDATE_DOCKERFILE_HADOLINT: true
2829
VALIDATE_MARKDOWN: true
2930
VALIDATE_SHELL_SHFMT: true

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"C_Cpp.clang_format_style": "file",
23
"[markdown]": {
34
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint",
45
"editor.formatOnSave": true,

0 commit comments

Comments
 (0)