Skip to content

Commit a1ec8e1

Browse files
committed
Updating cpp-library template to v1.1.2
1 parent fb097a3 commit a1ec8e1

File tree

4 files changed

+129
-2
lines changed

4 files changed

+129
-2
lines changed

.clang-format

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Format style options described here:
2+
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
3+
4+
# Many of the alignment and single line changes were made to facilitate setting
5+
# breakpoints on specific expressions.
6+
7+
---
8+
AccessModifierOffset: -4
9+
AlignAfterOpenBracket: Align
10+
AlignConsecutiveAssignments: false
11+
AlignConsecutiveDeclarations: false
12+
AlignEscapedNewlines: Left
13+
AlignOperands: true
14+
AlignTrailingComments: true
15+
AllowAllParametersOfDeclarationOnNextLine: true
16+
AllowShortBlocksOnASingleLine: false
17+
AllowShortCaseLabelsOnASingleLine: false
18+
AllowShortFunctionsOnASingleLine: All
19+
AllowShortIfStatementsOnASingleLine: true
20+
AllowShortLoopsOnASingleLine: false
21+
# AlwaysBreakAfterDefinitionReturnType: TopLevel
22+
AlwaysBreakAfterReturnType: None
23+
AlwaysBreakBeforeMultilineStrings: false
24+
AlwaysBreakTemplateDeclarations: true
25+
BinPackArguments: true
26+
BinPackParameters: false
27+
# BraceWrapping:
28+
# AfterClass: true
29+
# AfterControlStatement: false
30+
# AfterEnum: false
31+
# AfterFunction: false
32+
# AfterNamespace: false
33+
# AfterObjCDeclaration: false
34+
# AfterStruct: false
35+
# AfterUnion: false
36+
# AfterExternBlock: false
37+
# BeforeCatch: false
38+
# BeforeElse: false
39+
# IndentBraces: false
40+
# SplitEmptyFunction: true
41+
# SplitEmptyRecord: true
42+
# SplitEmptyNamespace: true
43+
BreakBeforeBinaryOperators: None
44+
BreakBeforeBraces: Attach
45+
BreakBeforeInheritanceComma: false
46+
BreakBeforeTernaryOperators: false
47+
BreakConstructorInitializersBeforeComma: false
48+
BreakConstructorInitializers: AfterColon
49+
BreakAfterJavaFieldAnnotations: false
50+
BreakStringLiterals: false
51+
ColumnLimit: 100
52+
CommentPragmas: '^ IWYU pragma:'
53+
CompactNamespaces: false
54+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
55+
ConstructorInitializerIndentWidth: 4
56+
ContinuationIndentWidth: 4
57+
Cpp11BracedListStyle: true
58+
DerivePointerAlignment: false
59+
DisableFormat: false
60+
ExperimentalAutoDetectBinPacking: false
61+
FixNamespaceComments: true
62+
ForEachMacros:
63+
- foreach
64+
- Q_FOREACH
65+
- BOOST_FOREACH
66+
IncludeBlocks: Preserve
67+
IncludeCategories:
68+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
69+
Priority: 2
70+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
71+
Priority: 3
72+
- Regex: '.*'
73+
Priority: 1
74+
IncludeIsMainRegex: '$'
75+
IndentCaseLabels: true
76+
IndentPPDirectives: None # Other option is AfterHash, which indents top level includes as well
77+
IndentWidth: 4
78+
IndentWrappedFunctionNames: true
79+
JavaScriptQuotes: Leave
80+
JavaScriptWrapImports: true
81+
KeepEmptyLinesAtTheStartOfBlocks: false
82+
MacroBlockBegin: ''
83+
MacroBlockEnd: ''
84+
MaxEmptyLinesToKeep: 1
85+
NamespaceIndentation: None
86+
ObjCBlockIndentWidth: 4
87+
ObjCSpaceAfterProperty: true
88+
ObjCSpaceBeforeProtocolList: true
89+
PenaltyBreakAssignment: 2
90+
PenaltyBreakBeforeFirstCallParameter: 19
91+
PenaltyBreakComment: 300
92+
PenaltyBreakFirstLessLess: 120
93+
PenaltyBreakString: 1000
94+
PenaltyExcessCharacter: 1000000
95+
PenaltyReturnTypeOnItsOwnLine: 1000
96+
PointerAlignment: Left
97+
ReflowComments: true
98+
SortIncludes: true
99+
SortUsingDeclarations: true
100+
SpaceAfterCStyleCast: false
101+
SpaceAfterTemplateKeyword: true
102+
SpaceBeforeAssignmentOperators: true
103+
SpaceBeforeParens: ControlStatements
104+
SpaceInEmptyParentheses: false
105+
SpacesBeforeTrailingComments: 1
106+
SpacesInAngles: false
107+
SpacesInContainerLiterals: true
108+
SpacesInCStyleCastParentheses: false
109+
SpacesInParentheses: false
110+
SpacesInSquareBrackets: false
111+
Standard: c++17
112+
TabWidth: 4
113+
UseTab: Never
114+
---
115+
Language: Cpp
116+
---
117+
Language: ObjC
118+
PointerAlignment: Right
119+
...

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/.cpm-cache
22
/.cache
33
/build
4-
compile_commands.json
54
.DS_Store
5+
compile_commands.json

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"matepek.vscode-catch2-test-adapter",
4+
"llvm-vs-code-extensions.vscode-clangd",
5+
"ms-vscode.live-server",
6+
"xaver.clang-format"
7+
]
8+
}

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include(cmake/CPM.cmake)
77

88
# Fetch cpp-library via CPM (using local path for development)
99
CPMAddPackage(
10-
URI gh:stlab/cpp-library@1.0.0
10+
URI "gh:stlab/cpp-library@1.1.2"
1111
DOWNLOAD_ONLY YES
1212
)
1313
include(${cpp-library_SOURCE_DIR}/cpp-library.cmake)

0 commit comments

Comments
 (0)