Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/.clang-format
blob: 5efabd435505d1a9f6e9c132dabbaa71c80f2288 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
# SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0

---
# Progmasoft C++ Style format profile, pinned to LLVM/Clang 23.1.0.
# Naming is intentionally outside clang-format and remains governed by the
# PascalCase/camelCase conventions of Progmasoft C++ Style.
Language: Cpp
BasedOnStyle: LLVM
Standard: c++17

UseTab: Never
IndentWidth: 4
ContinuationIndentWidth: 4
ConstructorInitializerIndentWidth: 4
AccessModifierOffset: -4
IndentAccessModifiers: false

# Keep formatted C++ source within the agreed 80-column width.
ColumnLimit: 80

BreakBeforeBraces: Custom
BraceWrapping:
  AfterCaseLabel: true
  AfterClass: true
  AfterControlStatement: Always
  AfterEnum: true
  AfterExternBlock: true
  AfterFunction: true
  AfterNamespace: true
  AfterStruct: true
  AfterUnion: true
  BeforeCatch: true
  BeforeElse: true
  BeforeLambdaBody: false
  BeforeWhile: false
  IndentBraces: false
  SplitEmptyFunction: false
  SplitEmptyRecord: false
  SplitEmptyNamespace: false

AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AllowShortNamespacesOnASingleLine: false
AllowShortRecordOnASingleLine: Never

# Function declarations and definitions keep the return type on its own line.
BreakAfterReturnType: All

PackArguments:
  BinPack: OnePerLine
PackParameters:
  BinPack: OnePerLine
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false

BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: true
AlignOperands: Align

BreakConstructorInitializers: BeforeComma
PackConstructorInitializers: Never
BreakInheritanceList: BeforeComma

PointerAlignment: Right
DerivePointerAlignment: false
QualifierAlignment: Leave

SpaceBeforeParens: ControlStatements
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCtorInitializerColon: false
SpaceBeforeInheritanceColon: false
SpaceBeforeCpp11BracedList: false
SpacesInAngles: Never
SpacesInSquareBrackets: false
SpacesInParens: Never
SpaceInEmptyBraces: Never

Cpp11BracedListStyle: Block

SpaceAfterTemplateKeyword: false
BreakTemplateDeclarations: Yes

IndentCaseLabels: true
IndentCaseBlocks: false

NamespaceIndentation: All
FixNamespaceComments: true
ShortNamespaceLines: 0
CompactNamespaces: false

IndentPPDirectives: AfterHash
PPIndentWidth: 4

# System headers precede project headers, with alphabetical ordering per group.
IncludeBlocks: Regroup
SortIncludes: CaseSensitive
IncludeIsMainRegex: '$^'
IncludeCategories:
  - Regex: '^<.*>$'
    Priority: 1
    SortPriority: 1
  - Regex: '^".*"$'
    Priority: 2
    SortPriority: 2

MaxEmptyLinesToKeep: 1
KeepEmptyLines:
  AtStartOfBlock: false

ReflowComments: true
SortUsingDeclarations: Lexicographic

# Match the dominant line-ending convention of each input file.
LineEnding: DeriveLF
InsertNewlineAtEOF: true
...