Skip to content

Commit bfc9a8b

Browse files
committed
Add comprehensive CI/CD infrastructure
GitHub Actions workflows: - ci.yml: Multi-platform builds (Linux/macOS/Windows), sanitizers, minimal deps - code-quality.yml: Formatting, static analysis, security scanning, coverage - release.yml: Automated releases with cross-platform assets Code quality tools: - .clang-format: Google-based C++20 formatting rules - .clang-tidy: Comprehensive static analysis configuration Testing infrastructure: - doctest integration for unit tests - Mock implementations for testing interfaces - CMake test discovery and CTest integration Build system improvements: - Updated CMakeLists.txt for llmcpp with proper dependencies - Example projects structure - Stub implementations for all components to enable CI builds All components are stubs/placeholders - ready for CI/CD validation
1 parent 4d8093b commit bfc9a8b

22 files changed

+1473
-266
lines changed

.clang-format

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
BasedOnStyle: Google
3+
Language: Cpp
4+
Standard: c++20
5+
6+
# Indentation
7+
IndentWidth: 4
8+
TabWidth: 4
9+
UseTab: Never
10+
ContinuationIndentWidth: 4
11+
IndentCaseLabels: true
12+
IndentPPDirectives: BeforeHash
13+
14+
# Line length
15+
ColumnLimit: 100
16+
ReflowComments: true
17+
18+
# Braces
19+
BreakBeforeBraces: Attach
20+
BraceWrapping:
21+
AfterClass: false
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: false
25+
AfterNamespace: false
26+
AfterStruct: false
27+
AfterUnion: false
28+
BeforeCatch: false
29+
BeforeElse: false
30+
31+
# Spacing
32+
SpaceBeforeParens: ControlStatements
33+
SpaceInEmptyParentheses: false
34+
SpacesInParentheses: false
35+
SpacesInSquareBrackets: false
36+
SpaceAfterCStyleCast: false
37+
SpaceBeforeAssignmentOperators: true
38+
SpaceBeforeCpp11BracedList: false
39+
SpaceBeforeCtorInitializerColon: true
40+
SpaceBeforeInheritanceColon: true
41+
SpaceBeforeRangeBasedForLoopColon: true
42+
43+
# Alignment
44+
AlignAfterOpenBracket: Align
45+
AlignConsecutiveAssignments: false
46+
AlignConsecutiveDeclarations: false
47+
AlignEscapedNewlines: Left
48+
AlignOperands: true
49+
AlignTrailingComments: true
50+
51+
# Breaking
52+
AllowAllArgumentsOnNextLine: true
53+
AllowAllConstructorInitializersOnNextLine: true
54+
AllowAllParametersOfDeclarationOnNextLine: true
55+
AllowShortBlocksOnASingleLine: Never
56+
AllowShortCaseLabelsOnASingleLine: false
57+
AllowShortFunctionsOnASingleLine: Empty
58+
AllowShortIfStatementsOnASingleLine: Never
59+
AllowShortLoopsOnASingleLine: false
60+
AllowShortLambdasOnASingleLine: All
61+
62+
# Breaking before binary operators
63+
BreakBeforeBinaryOperators: None
64+
BreakBeforeTernaryOperators: true
65+
BreakConstructorInitializers: BeforeColon
66+
BreakInheritanceList: BeforeColon
67+
BreakStringLiterals: true
68+
69+
# Constructor initializers
70+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
71+
ConstructorInitializerIndentWidth: 4
72+
73+
# Includes
74+
IncludeBlocks: Preserve
75+
SortIncludes: true
76+
SortUsingDeclarations: true
77+
78+
# Penalties (for line breaking decisions)
79+
PenaltyBreakAssignment: 2
80+
PenaltyBreakBeforeFirstCallParameter: 19
81+
PenaltyBreakComment: 300
82+
PenaltyBreakFirstLessLess: 120
83+
PenaltyBreakString: 1000
84+
PenaltyBreakTemplateDeclaration: 10
85+
PenaltyExcessCharacter: 1000000
86+
PenaltyReturnTypeOnItsOwnLine: 200
87+
88+
# Pointer and reference alignment
89+
DerivePointerAlignment: false
90+
PointerAlignment: Left
91+
92+
# Namespaces
93+
NamespaceIndentation: None
94+
CompactNamespaces: false
95+
96+
# Access modifiers
97+
AccessModifierOffset: -4
98+
99+
# Comments
100+
ReflowComments: true
101+
CommentPragmas: '^ IWYU pragma:'
102+
103+
# Macros
104+
MacroBlockBegin: ''
105+
MacroBlockEnd: ''
106+
107+
# Experimental
108+
ExperimentalAutoDetectBinPacking: false
109+
BinPackArguments: false
110+
BinPackParameters: false
111+
112+
# C++11/14/17/20 specific
113+
Cpp11BracedListStyle: true
114+
FixNamespaceComments: true

.clang-tidy

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
# clang-tidy configuration for llmcpp
3+
Checks: >
4+
-*,
5+
bugprone-*,
6+
cert-*,
7+
clang-analyzer-*,
8+
concurrency-*,
9+
cppcoreguidelines-*,
10+
google-*,
11+
hicpp-*,
12+
misc-*,
13+
modernize-*,
14+
performance-*,
15+
portability-*,
16+
readability-*,
17+
-bugprone-easily-swappable-parameters,
18+
-cert-err58-cpp,
19+
-cppcoreguidelines-avoid-magic-numbers,
20+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
21+
-cppcoreguidelines-pro-type-vararg,
22+
-google-runtime-references,
23+
-hicpp-avoid-magic-numbers,
24+
-hicpp-vararg,
25+
-misc-non-private-member-variables-in-classes,
26+
-modernize-use-trailing-return-type,
27+
-readability-magic-numbers,
28+
-readability-named-parameter
29+
30+
WarningsAsErrors: ''
31+
HeaderFilterRegex: '.*'
32+
FormatStyle: file
33+
InheritParentConfig: false
34+
35+
CheckOptions:
36+
# Naming conventions
37+
- key: readability-identifier-naming.ClassCase
38+
value: CamelCase
39+
- key: readability-identifier-naming.ClassMemberCase
40+
value: camelCase
41+
- key: readability-identifier-naming.ClassMemberSuffix
42+
value: '_'
43+
- key: readability-identifier-naming.ConstantCase
44+
value: UPPER_CASE
45+
- key: readability-identifier-naming.EnumCase
46+
value: CamelCase
47+
- key: readability-identifier-naming.EnumConstantCase
48+
value: CamelCase
49+
- key: readability-identifier-naming.FunctionCase
50+
value: camelCase
51+
- key: readability-identifier-naming.GlobalConstantCase
52+
value: UPPER_CASE
53+
- key: readability-identifier-naming.LocalConstantCase
54+
value: camelCase
55+
- key: readability-identifier-naming.LocalVariableCase
56+
value: camelCase
57+
- key: readability-identifier-naming.MemberCase
58+
value: camelCase
59+
- key: readability-identifier-naming.NamespaceCase
60+
value: lower_case
61+
- key: readability-identifier-naming.ParameterCase
62+
value: camelCase
63+
- key: readability-identifier-naming.PrivateMemberSuffix
64+
value: '_'
65+
- key: readability-identifier-naming.ProtectedMemberSuffix
66+
value: '_'
67+
- key: readability-identifier-naming.PublicMemberCase
68+
value: camelCase
69+
- key: readability-identifier-naming.StaticConstantCase
70+
value: UPPER_CASE
71+
- key: readability-identifier-naming.StaticVariableCase
72+
value: camelCase
73+
- key: readability-identifier-naming.StructCase
74+
value: CamelCase
75+
- key: readability-identifier-naming.TemplateParameterCase
76+
value: CamelCase
77+
- key: readability-identifier-naming.TypeAliasCase
78+
value: CamelCase
79+
- key: readability-identifier-naming.TypedefCase
80+
value: CamelCase
81+
- key: readability-identifier-naming.UnionCase
82+
value: CamelCase
83+
- key: readability-identifier-naming.VariableCase
84+
value: camelCase
85+
86+
# Function length
87+
- key: readability-function-size.LineThreshold
88+
value: 100
89+
- key: readability-function-size.StatementThreshold
90+
value: 50
91+
- key: readability-function-size.BranchThreshold
92+
value: 15
93+
- key: readability-function-size.ParameterThreshold
94+
value: 8
95+
96+
# Complexity
97+
- key: readability-function-cognitive-complexity.Threshold
98+
value: 15
99+
100+
# Performance
101+
- key: performance-for-range-copy.WarnOnAllAutoCopies
102+
value: true
103+
- key: performance-move-const-arg.CheckTriviallyCopyableMove
104+
value: true
105+
- key: performance-type-promotion-in-math-fn.IncludeStyle
106+
value: google
107+
108+
# Modernize
109+
- key: modernize-loop-convert.MaxCopySize
110+
value: 16
111+
- key: modernize-loop-convert.MinConfidence
112+
value: reasonable
113+
- key: modernize-pass-by-value.IncludeStyle
114+
value: google
115+
116+
# Misc
117+
- key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries
118+
value: true
119+
120+
# Google style
121+
- key: google-readability-braces-around-statements.ShortStatementLines
122+
value: 1
123+
- key: google-readability-function-size.StatementThreshold
124+
value: 50
125+
- key: google-readability-namespace-comments.ShortNamespaceLines
126+
value: 1
127+
- key: google-readability-namespace-comments.SpacesBeforeComments
128+
value: 2

0 commit comments

Comments
 (0)