Skip to content

Commit 3fc415d

Browse files
committed
ci: Update cxx cmake example
0 parents  commit 3fc415d

38 files changed

+14853
-0
lines changed

.clang-format

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
# Base Style
3+
BasedOnStyle: Google # Based on Google style guidelines
4+
Language: Cpp # Explicitly specify C++
5+
Standard: c++17 # Use C++17 standard
6+
7+
# Code Layout
8+
ColumnLimit: 180 # Recommended maximum line length
9+
IndentWidth: 4 # 4-space indentation
10+
InsertNewlineAtEOF: true # Ensure newline at end of file
11+
UseTab: Never # Exclusively use spaces for indentation
12+
13+
# Code Structure
14+
AllowShortIfStatementsOnASingleLine: Never # Prevent single-line if statements
15+
AllowShortFunctionsOnASingleLine: Inline # Allow short functions on single line
16+
AllowShortLoopsOnASingleLine: false # Prevent single-line loops
17+
BinPackArguments: false
18+
BinPackParameters: OnePerLine
19+
BreakBeforeBraces: Attach # Attach braces to code block
20+
BreakBeforeBinaryOperators: NonAssignment # Break before non-assignment operators
21+
BreakBeforeTernaryOperators: true # Break before ternary operators
22+
BreakConstructorInitializers: BeforeColon # Break constructor initializers before colon
23+
BreakInheritanceList: BeforeColon # Break inheritance list before colon
24+
InsertBraces: true # Automatically insert braces for clarity
25+
PackConstructorInitializers: Never
26+
27+
# Language Features
28+
AccessModifierOffset: -4 # Offset for access modifiers
29+
CompactNamespaces: false # Keep namespaces readable
30+
FixNamespaceComments: true # Properly format namespace comments
31+
IndentCaseLabels: true # Indent switch case labels
32+
NamespaceIndentation: All # Indent inside namespaces
33+
34+
# Pointers and References
35+
DerivePointerAlignment: false # Manually set pointer alignment
36+
PointerAlignment: Left # Left-align pointers and references
37+
38+
# Spacing and Alignment
39+
SpaceAroundPointerQualifiers: Default # Consistent space around pointer qualifiers
40+
SpaceBeforeParens: ControlStatements # Space before parentheses in control statements
41+
SpaceBeforeCtorInitializerColon: true # Space before constructor initializer colon
42+
SpaceBeforeInheritanceColon: true # Space before inheritance colon
43+
SpaceBeforeRangeBasedForLoopColon: true # Space before range-based for loop colon
44+
SpacesBeforeTrailingComments: 2 # Two spaces before trailing comments
45+
SpacesInContainerLiterals: false # No extra spaces in container literals
46+
SpacesInParensOptions:
47+
InEmptyParentheses: false # No spaces in empty parentheses
48+
SpacesInSquareBrackets: false # No extra spaces in square brackets
49+
50+
# Comments and Includes
51+
AlignTrailingComments:
52+
Kind: Always # Strictly align trailing comments
53+
ReflowComments: true # Reflow comments to fit column limit
54+
SortIncludes: CaseSensitive # Sort includes in case-sensitive manner

.clang-tidy

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Checks: >
2+
-*, # Disable all checks by default
3+
bugprone-*,
4+
readability-*,
5+
performance-*,
6+
modernize-*,
7+
cppcoreguidelines-*,
8+
clang-analyzer-*,
9+
portability-*,
10+
security-*,
11+
misc-*,
12+
google-*,
13+
14+
CheckOptions:
15+
# Naming conventions
16+
- key: readability-identifier-naming.ClassCase
17+
value: CamelCase
18+
- key: readability-identifier-naming.StructCase
19+
value: CamelCase
20+
- key: readability-identifier-naming.EnumCase
21+
value: CamelCase
22+
- key: readability-identifier-naming.MethodCase
23+
value: lower_case
24+
- key: readability-identifier-naming.FunctionCase
25+
value: lower_case
26+
- key: readability-identifier-naming.VariableCase
27+
value: lower_case
28+
- key: readability-identifier-naming.ParameterCase
29+
value: lower_case
30+
- key: readability-identifier-naming.MemberCase
31+
value: m_camelBack
32+
- key: readability-identifier-naming.StaticMemberCase
33+
value: s_camelBack
34+
- key: readability-identifier-naming.GlobalVariableCase
35+
value: g_lower_case
36+
- key: readability-identifier-naming.NamespaceCase
37+
value: lower_case
38+
39+
# Function complexity
40+
- key: readability-function-cognitive-complexity.Threshold
41+
value: 35
42+
43+
# Bug detection
44+
- key: bugprone-argument-comment
45+
value: 1
46+
- key: bugprone-branch-clone
47+
value: 1
48+
- key: bugprone-use-after-move
49+
value: 1
50+
51+
# Modern practices
52+
- key: modernize-use-nullptr.NullMacros
53+
value: 'NULL'
54+
- key: modernize-use-auto
55+
value: 1
56+
- key: modernize-avoid-bind
57+
value: 1
58+
59+
# Core guidelines
60+
- key: cppcoreguidelines-no-malloc
61+
value: 1
62+
- key: cppcoreguidelines-pro-type-cstyle-cast
63+
value: 1
64+
- key: cppcoreguidelines-special-member-functions
65+
value: 1
66+
67+
# Security
68+
- key: security-undefined-bool-conversion
69+
value: 1
70+
- key: security-implicit-int-float-conversion
71+
value: 1
72+
73+
# Performance
74+
- key: performance-unnecessary-copy-initialization
75+
value: 1
76+
- key: performance-for-range-copy
77+
value: 1
78+
- key: performance-move-const-arg
79+
value: 1

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# all start with .(dot), including directories and files
2+
.*
3+
CHANGELOG.md
4+
CODE_OF_CONDUCT.md
5+
CONTRIBUTING.md
6+
compose.yml
7+
LICENSE*
8+
Makefile
9+
README.md

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
max_line_length = 120
10+
tab_width = 4
11+
trim_trailing_whitespace = true
12+
13+
[Makefile]
14+
indent_style = tab
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: 'bug: '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Bug description
11+
12+
<!-- A clear and concise description of what the bug is. -->
13+
14+
- Would you like to work on a fix? [y/n]
15+
16+
## To Reproduce
17+
18+
Steps to reproduce the behavior:
19+
20+
1. ...
21+
2. ...
22+
3. ...
23+
4. ...
24+
25+
<!-- Make sure you are able to reproduce the bug in the main branch, too. -->
26+
27+
## Expected behavior
28+
29+
<!-- A clear and concise description of what you expected to happen. -->
30+
31+
## Screenshots
32+
33+
<!-- If applicable, add screenshots to help explain your problem. -->
34+
35+
## Environment
36+
37+
<!-- Please fill the following information. -->
38+
39+
- OS: [e.g. Ubuntu 20.04]
40+
- example-cxx-cmake version: [e.g. 0.1.0]
41+
42+
## Additional context
43+
44+
<!-- Add any other context about the problem here. -->

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: 'Feature Request: '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
## Motivations
11+
12+
<!--
13+
If your feature request is related to a problem, please describe it.
14+
-->
15+
16+
- Would you like to implement this feature? [y/n]
17+
18+
## Solution
19+
20+
<!-- Describe the solution you'd like. -->
21+
22+
## Alternatives
23+
24+
<!-- Describe any alternative solutions or features you've considered. -->
25+
26+
## Additional context
27+
28+
<!-- Add any other context or screenshots about the feature request here. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- Please explain the changes you made -->
2+
3+
<!--
4+
Please make sure:
5+
- you have read the contributing guidelines:
6+
https://github.com/x-pt/example-cxx-cmake/blob/main/docs/CONTRIBUTING.md
7+
- you have updated the changelog (if needed):
8+
https://github.com/x-pt/example-cxx-cmake/blob/main/CHANGELOG.md
9+
-->

.github/configs/labeler.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
version: 1
2+
3+
labels:
4+
# Type: Build-related changes
5+
- label: "@type/build"
6+
title: '^build(?:\(.+\))?\!?:'
7+
8+
# Type: CI-related changes
9+
- label: "@type/ci"
10+
title: '^ci(?:\(.+\))?\!?:'
11+
files:
12+
- '\.github/.+'
13+
14+
# Type: Documentation changes
15+
- label: "@type/docs"
16+
title: '^docs(?:\(.+\))?\!?:'
17+
files:
18+
- "docs/.+"
19+
- "**/*.md"
20+
21+
# Type: New feature
22+
- label: "@type/feature"
23+
title: '^feat(?:\(.+\))?\!?:'
24+
25+
# Type: Bug fix
26+
- label: "@type/fix"
27+
title: '^fix(?:\(.+\))?\!?:'
28+
29+
# Type: Improvements such as style changes, refactoring, or performance improvements
30+
- label: "@type/improve"
31+
title: '^(style|refactor|perf)(?:\(.+\))?\!?:'
32+
33+
# Type: Dependency changes
34+
- label: "@type/dependency"
35+
title: '^(chore|build)(?:\(deps\))?\!?:'
36+
37+
# Type: Test-related changes
38+
- label: "@type/test"
39+
title: '^test(?:\(.+\))?\!?:'
40+
files:
41+
- "tests/.+"
42+
- "spec/.+"
43+
44+
# Type: Security-related changes
45+
- label: "@type/security"
46+
title: '^security(?:\(.+\))?\!?:'
47+
files:
48+
- "**/security/.+"
49+
50+
# Issue Type Only: Feature Request
51+
- label: "Feature Request"
52+
type: issue
53+
title: "^Feature Request:"
54+
55+
# Issue Type Only: Documentation
56+
- label: "Documentation"
57+
type: issue
58+
title: "^.*(\b[Dd]ocumentation|doc(s)?\b).*"
59+
60+
# Issue Type Only: Bug Report
61+
- label: "Bug Report"
62+
type: issue
63+
title: "^.*(\b[Bb]ug|b(u)?g(s)?\b).*"

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
# Check for updates every Monday
6+
schedule:
7+
interval: "weekly"
8+
open-pull-requests-limit: 10

0 commit comments

Comments
 (0)