Skip to content

Commit dcd32e8

Browse files
committed
Initialize cleanup_static_checks_and_code_samples
0 parents  commit dcd32e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1825
-0
lines changed

.clang-format

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
AccessModifierOffset: -2
2+
AlignAfterOpenBracket: DontAlign
3+
AlignConsecutiveAssignments: false
4+
AlignConsecutiveDeclarations: false
5+
AlignEscapedNewlines: Left
6+
AlignOperands: true
7+
AlignTrailingComments: false
8+
AllowAllParametersOfDeclarationOnNextLine: false
9+
AllowShortBlocksOnASingleLine: true
10+
AllowShortCaseLabelsOnASingleLine: false
11+
AllowShortFunctionsOnASingleLine: All
12+
AllowShortIfStatementsOnASingleLine: true
13+
AllowShortLoopsOnASingleLine: true
14+
AlwaysBreakAfterDefinitionReturnType: None
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: true
17+
AlwaysBreakTemplateDeclarations: false
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BraceWrapping:
21+
AfterClass: true
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: true
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: true
28+
AfterUnion: false
29+
BeforeCatch: false
30+
BeforeElse: false
31+
IndentBraces: false
32+
SplitEmptyFunction: false
33+
SplitEmptyNamespace: true
34+
SplitEmptyRecord: true
35+
BreakAfterJavaFieldAnnotations: true
36+
BreakBeforeBinaryOperators: NonAssignment
37+
BreakBeforeBraces: Custom
38+
BreakBeforeInheritanceComma: true
39+
BreakBeforeTernaryOperators: true
40+
BreakConstructorInitializers: BeforeColon
41+
BreakConstructorInitializersBeforeComma: false
42+
BreakStringLiterals: true
43+
ColumnLimit: 120
44+
CommentPragmas: '^ IWYU pragma:'
45+
CompactNamespaces: false
46+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
47+
ConstructorInitializerIndentWidth: 2
48+
ContinuationIndentWidth: 2
49+
Cpp11BracedListStyle: false
50+
DerivePointerAlignment: false
51+
DisableFormat: false
52+
ExperimentalAutoDetectBinPacking: true
53+
FixNamespaceComments: true
54+
ForEachMacros:
55+
- foreach
56+
- Q_FOREACH
57+
- BOOST_FOREACH
58+
IncludeCategories:
59+
- Priority: 2
60+
Regex: ^"(llvm|llvm-c|clang|clang-c)/
61+
- Priority: 3
62+
Regex: ^(<|"(gtest|gmock|isl|json)/)
63+
- Priority: 1
64+
Regex: .*
65+
IncludeIsMainRegex: (Test)?$
66+
IndentCaseLabels: false
67+
IndentWidth: 2
68+
IndentWrappedFunctionNames: true
69+
JavaScriptQuotes: Leave
70+
JavaScriptWrapImports: true
71+
KeepEmptyLinesAtTheStartOfBlocks: true
72+
Language: Cpp
73+
MacroBlockBegin: ''
74+
MacroBlockEnd: ''
75+
MaxEmptyLinesToKeep: 2
76+
NamespaceIndentation: Inner
77+
ObjCBlockIndentWidth: 7
78+
ObjCSpaceAfterProperty: true
79+
ObjCSpaceBeforeProtocolList: false
80+
PointerAlignment: Right
81+
ReflowComments: true
82+
SortIncludes: true
83+
SortUsingDeclarations: false
84+
SpaceAfterCStyleCast: false
85+
SpaceAfterTemplateKeyword: false
86+
SpaceBeforeAssignmentOperators: true
87+
SpaceBeforeParens: ControlStatements
88+
SpaceInEmptyParentheses: false
89+
SpacesBeforeTrailingComments: 0
90+
SpacesInAngles: false
91+
SpacesInCStyleCastParentheses: false
92+
SpacesInContainerLiterals: true
93+
SpacesInParentheses: false
94+
SpacesInSquareBrackets: false
95+
Standard: c++20
96+
TabWidth: 8
97+
UseTab: Never
98+

.clang-tidy

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
Checks: "*,
3+
-abseil-*,
4+
-altera-*,
5+
-android-*,
6+
-fuchsia-*,
7+
-google-*,
8+
-llvm*,
9+
-modernize-use-trailing-return-type,
10+
-zircon-*,
11+
-readability-else-after-return,
12+
-readability-static-accessed-through-instance,
13+
-readability-avoid-const-params-in-decls,
14+
-cppcoreguidelines-non-private-member-variables-in-classes,
15+
-misc-non-private-member-variables-in-classes,
16+
"
17+
WarningsAsErrors: ''
18+
HeaderFilterRegex: ''
19+
FormatStyle: none
20+
21+
22+
23+
24+
25+

.cmake-format.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
additional_commands:
2+
foo:
3+
flags:
4+
- BAR
5+
- BAZ
6+
kwargs:
7+
DEPENDS: '*'
8+
HEADERS: '*'
9+
SOURCES: '*'
10+
bullet_char: '*'
11+
dangle_parens: false
12+
enum_char: .
13+
line_ending: unix
14+
line_width: 120
15+
max_pargs_hwrap: 3
16+
separate_ctrl_name_with_space: false
17+
separate_fn_name_with_space: false
18+
tab_size: 2
19+
20+
markup:
21+
enable_markup: false

.github/FUNDING.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# These are supported funding model platforms
2+
3+
github: lefticus
4+
patreon: lefticus
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: auto-clang-format
2+
on: [pull_request]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: DoozyX/[email protected]
11+
with:
12+
source: '.'
13+
exclude: './third_party ./external'
14+
extensions: 'h,cpp,hpp'
15+
clangFormatVersion: 12
16+
inplace: True
17+
- uses: EndBug/add-and-commit@v4
18+
with:
19+
author_name: Clang Robot
20+
author_email: [email protected]
21+
message: ':art: Committing clang-format changes'
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: ci
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
env:
10+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
11+
# Conan cache environment variables
12+
CONAN_SYSREQUIRES_MODE: enabled
13+
CONAN_USER_HOME: "${{ github.workspace }}/conan-cache"
14+
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-cache/short"
15+
16+
jobs:
17+
Test:
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os:
23+
- windows-2019
24+
- ubuntu-20.04
25+
- macos-10.15
26+
compiler:
27+
# you can specify the version after `-` like "llvm-13.0.0".
28+
- llvm
29+
- gcc
30+
generator:
31+
- "Ninja Multi-Config"
32+
build_type:
33+
- Release
34+
- Debug
35+
developer_mode:
36+
- ON
37+
- OFF
38+
exclude:
39+
# mingw has threading, pch, and static library issues
40+
# you can attempt to use it in your own project if you desire.
41+
- os: "windows-2019"
42+
compiler: gcc
43+
include:
44+
- os: "windows-2019"
45+
compiler: "msvc"
46+
build_type: Release
47+
developer_mode: ON
48+
generator: "Visual Studio 16 2019"
49+
- os: "windows-2019"
50+
compiler: "msvc"
51+
build_type: Release
52+
developer_mode: OFF
53+
generator: "Visual Studio 16 2019"
54+
- os: "windows-2019"
55+
compiler: "msvc"
56+
build_type: Debug
57+
developer_mode: ON
58+
generator: "Visual Studio 16 2019"
59+
- os: "windows-2019"
60+
compiler: "msvc"
61+
build_type: RelWithDebInfo
62+
developer_mode: ON
63+
generator: "Visual Studio 16 2019"
64+
65+
66+
67+
steps:
68+
- uses: actions/checkout@v2
69+
70+
- name: Cache
71+
uses: actions/cache@v2
72+
with:
73+
path: |
74+
~/vcpkg
75+
./build/vcpkg_installed
76+
${{ env.CONAN_USER_HOME }}
77+
~/.cache/pip
78+
${{ env.HOME }}/.cache/vcpkg/archives
79+
${{ env.XDG_CACHE_HOME }}/vcpkg/archives
80+
${{ env.LOCALAPPDATA }}\vcpkg\archives
81+
${{ env.APPDATA }}\vcpkg\archives
82+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{matrix.build_type}}-${{matrix.generator}}-${{matrix.developer_mode}}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./conanfile.txt')}}-${{ hashFiles('./vcpkg.json')}}
83+
restore-keys: |
84+
${{ runner.os }}-${{ matrix.compiler }}-${{matrix.build_type}}-${{matrix.generator}}-${{matrix.developer_mode}}
85+
86+
- name: Setup Cpp
87+
uses: aminya/setup-cpp@v1
88+
with:
89+
compiler: ${{ matrix.compiler }}
90+
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
91+
92+
cmake: true
93+
ninja: true
94+
conan: true
95+
vcpkg: false
96+
ccache: true
97+
clangtidy: true
98+
99+
cppcheck: true
100+
101+
gcovr: true
102+
opencppcoverage: true
103+
104+
- name: Configure CMake
105+
run: |
106+
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DENABLE_DEVELOPER_MODE:BOOL=${{matrix.developer_mode}}
107+
108+
- name: Build
109+
# Execute the build. You can specify a specific target with "--target <NAME>"
110+
run: |
111+
cmake --build ./build --config ${{matrix.build_type}}
112+
113+
- name: Unix - Test and coverage
114+
if: runner.os != 'Windows'
115+
working-directory: ./build
116+
# Execute tests defined by the CMake configuration.
117+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
118+
run: |
119+
ctest -C ${{matrix.build_type}}
120+
gcovr -j ${{env.nproc}} --delete --root ../ --print-summary --xml-pretty --xml coverage.xml .
121+
122+
- name: Windows - Test and coverage
123+
if: runner.os == 'Windows'
124+
working-directory: ./build
125+
run: |
126+
OpenCppCoverage.exe --sources cpp_starter_project --export_type cobertura:coverage.xml --cover_children -- ctest -C ${{matrix.build_type}}
127+
128+
- name: Publish to codecov
129+
uses: codecov/codecov-action@v2
130+
with:
131+
flags: ${{ runner.os }}
132+
name: ${{ runner.os }}-coverage
133+
files: ./build/coverage.xml

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Build directories and binary files
2+
build/
3+
out/
4+
cmake-build-*/
5+
6+
# IDE files
7+
.vs/
8+
.idea/
9+
.vscode/
10+
!.vscode/settings.json
11+
!.vscode/tasks.json
12+
!.vscode/launch.json
13+
!.vscode/extensions.json
14+
*.swp
15+
*~
16+
17+
# OS Generated Files
18+
.DS_Store
19+
.AppleDouble
20+
.LSOverride
21+
._*
22+
.Spotlight-V100
23+
.Trashes
24+
.Trash-*
25+
$RECYCLE.BIN/
26+
.TemporaryItems
27+
ehthumbs.db
28+
Thumbs.db

.gitlab-ci.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
image: ubuntu:latest
2+
3+
stages:
4+
- test
5+
6+
.setup_linux: &setup_linux |
7+
DEBIAN_FRONTEND=noninteractive
8+
9+
# set time-zone
10+
TZ=Canada/Pacific
11+
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
12+
13+
# for downloading
14+
apt-get update -qq
15+
apt-get install -y --no-install-recommends curl gnupg ca-certificates
16+
17+
# keys used by apt
18+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
19+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
20+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F
21+
22+
.setup_cpp: &setup_cpp |
23+
curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.5.8/setup_cpp_linux"
24+
chmod +x setup_cpp_linux
25+
./setup_cpp_linux --compiler $compiler --cmake true --ninja true --conan true --ccache true
26+
source ~/.profile
27+
28+
.test: &test |
29+
# Build and Test
30+
cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
31+
cmake --build ./build --config RelWithDebInfo
32+
33+
test_linux_llvm:
34+
stage: test
35+
variables:
36+
compiler: llvm
37+
script:
38+
- *setup_linux
39+
- *setup_cpp
40+
- *test
41+
42+
test_linux_gcc:
43+
stage: test
44+
variables:
45+
compiler: gcc
46+
script:
47+
- *setup_linux
48+
- *setup_cpp
49+
- *test

0 commit comments

Comments
 (0)