Skip to content

Commit b40cb83

Browse files
committed
Initial commit
0 parents  commit b40cb83

37 files changed

+2741
-0
lines changed

.clang-format

+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: Google
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: None
7+
AlignConsecutiveAssignments: None
8+
AlignConsecutiveBitFields: None
9+
AlignConsecutiveDeclarations: None
10+
AlignEscapedNewlines: Left
11+
AlignOperands: Align
12+
AlignTrailingComments: true
13+
AllowAllArgumentsOnNextLine: true
14+
AllowAllConstructorInitializersOnNextLine: true
15+
AllowAllParametersOfDeclarationOnNextLine: true
16+
AllowShortEnumsOnASingleLine: false
17+
AllowShortBlocksOnASingleLine: Never
18+
AllowShortCaseLabelsOnASingleLine: false
19+
AllowShortFunctionsOnASingleLine: All
20+
AllowShortLambdasOnASingleLine: Empty
21+
AllowShortIfStatementsOnASingleLine: WithoutElse
22+
AllowShortLoopsOnASingleLine: true
23+
AlwaysBreakAfterDefinitionReturnType: None
24+
AlwaysBreakAfterReturnType: None
25+
AlwaysBreakBeforeMultilineStrings: true
26+
AlwaysBreakTemplateDeclarations: Yes
27+
BinPackArguments: true
28+
BinPackParameters: true
29+
BraceWrapping:
30+
AfterCaseLabel: false
31+
AfterClass: false
32+
AfterControlStatement: Never
33+
AfterEnum: false
34+
AfterFunction: false
35+
AfterNamespace: false
36+
AfterObjCDeclaration: false
37+
AfterStruct: false
38+
AfterUnion: false
39+
AfterExternBlock: false
40+
BeforeCatch: false
41+
BeforeElse: false
42+
BeforeLambdaBody: true
43+
BeforeWhile: false
44+
IndentBraces: false
45+
SplitEmptyFunction: true
46+
SplitEmptyRecord: true
47+
SplitEmptyNamespace: true
48+
BreakBeforeBinaryOperators: None
49+
BreakBeforeConceptDeclarations: true
50+
BreakBeforeBraces: Allman
51+
BreakBeforeInheritanceComma: false
52+
BreakInheritanceList: BeforeColon
53+
BreakBeforeTernaryOperators: true
54+
BreakConstructorInitializersBeforeComma: false
55+
BreakConstructorInitializers: BeforeColon
56+
BreakAfterJavaFieldAnnotations: false
57+
BreakStringLiterals: true
58+
ColumnLimit: 120
59+
CompactNamespaces: false
60+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
61+
ConstructorInitializerIndentWidth: 4
62+
ContinuationIndentWidth: 4
63+
Cpp11BracedListStyle: true
64+
DeriveLineEnding: true
65+
DerivePointerAlignment: false
66+
DisableFormat: false
67+
EmptyLineBeforeAccessModifier: LogicalBlock
68+
ExperimentalAutoDetectBinPacking: false
69+
FixNamespaceComments: true
70+
IncludeBlocks: Regroup
71+
IncludeCategories:
72+
# Headers in <> without extension.
73+
- Regex: '<([A-Za-z0-9\Q/-_\E])+>'
74+
Priority: 3
75+
SortPriority: 0
76+
CaseSensitive: false
77+
# Headers in <> with extension.
78+
- Regex: '<([A-Za-z0-9.\Q/-_\E])+>'
79+
Priority: 2
80+
SortPriority: 0
81+
CaseSensitive: false
82+
# Headers in "" with extension.
83+
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
84+
Priority: 1
85+
SortPriority: 0
86+
CaseSensitive: false
87+
- Regex: '.*'
88+
Priority: 0
89+
SortPriority: 0
90+
CaseSensitive: false
91+
IncludeIsMainRegex: '([-_](test|unittest))?$'
92+
IncludeIsMainSourceRegex: ''
93+
IndentCaseLabels: true
94+
IndentCaseBlocks: false
95+
IndentGotoLabels: true
96+
IndentPPDirectives: None
97+
IndentExternBlock: AfterExternBlock
98+
IndentRequires: false
99+
IndentWidth: 4
100+
IndentWrappedFunctionNames: false
101+
InsertTrailingCommas: None
102+
JavaScriptQuotes: Leave
103+
JavaScriptWrapImports: true
104+
KeepEmptyLinesAtTheStartOfBlocks: false
105+
MacroBlockBegin: ''
106+
MacroBlockEnd: ''
107+
MaxEmptyLinesToKeep: 1
108+
NamespaceIndentation: None
109+
PenaltyBreakAssignment: 2
110+
PenaltyBreakBeforeFirstCallParameter: 1
111+
PenaltyBreakComment: 300
112+
PenaltyBreakFirstLessLess: 120
113+
PenaltyBreakString: 1000
114+
PenaltyBreakTemplateDeclaration: 10
115+
PenaltyExcessCharacter: 1000000
116+
PenaltyReturnTypeOnItsOwnLine: 200
117+
PenaltyIndentedWhitespace: 0
118+
PointerAlignment: Left
119+
RawStringFormats:
120+
- Language: Cpp
121+
Delimiters:
122+
- cc
123+
- CC
124+
- cpp
125+
- Cpp
126+
- CPP
127+
- 'c++'
128+
- 'C++'
129+
CanonicalDelimiter: ''
130+
BasedOnStyle: google
131+
ReflowComments: true
132+
SortIncludes: true
133+
SortJavaStaticImport: Before
134+
SortUsingDeclarations: true
135+
SpaceAfterCStyleCast: false
136+
SpaceAfterLogicalNot: false
137+
SpaceAfterTemplateKeyword: true
138+
SpaceBeforeAssignmentOperators: true
139+
SpaceBeforeCaseColon: false
140+
SpaceBeforeCpp11BracedList: false
141+
SpaceBeforeCtorInitializerColon: true
142+
SpaceBeforeInheritanceColon: true
143+
SpaceBeforeParens: ControlStatements
144+
SpaceAroundPointerQualifiers: Default
145+
SpaceBeforeRangeBasedForLoopColon: true
146+
SpaceInEmptyBlock: false
147+
SpaceInEmptyParentheses: false
148+
SpacesBeforeTrailingComments: 2
149+
SpacesInAngles: false
150+
SpacesInConditionalStatement: false
151+
SpacesInContainerLiterals: true
152+
SpacesInCStyleCastParentheses: false
153+
SpacesInParentheses: false
154+
SpacesInSquareBrackets: false
155+
SpaceBeforeSquareBrackets: false
156+
BitFieldColonSpacing: Both
157+
Standard: c++20
158+
TabWidth: 8
159+
UseCRLF: false
160+
UseTab: Never
161+
---
162+
Language: Proto
163+
BasedOnStyle: Google

.clang-tidy

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
Checks: 'clang-diagnostic-*,clang-analyzer-*,readability-*,modernize-*,performance-*,bugprone-*,cert-*,-readability-uppercase-literal-suffix,-readability-magic-numbers,-readability-avoid-const-params-in-decls,-readability-named-parameter,-modernize-use-trailing-return-type,-modernize-avoid-c-arrays'
3+
WarningsAsErrors: ''
4+
HeaderFilterRegex: ''
5+
AnalyzeTemporaryDtors: false
6+
FormatStyle: none
7+
CheckOptions:
8+
- key: readability-identifier-naming.NamespaceCase
9+
value: lower_case
10+
- key: readability-identifier-naming.ClassCase
11+
value: CamelCase
12+
- key: readability-identifier-naming.StructCase
13+
value: CamelCase
14+
- key: readability-identifier-naming.TemplateParameterCase
15+
value: CamelCase
16+
- key: readability-identifier-naming.FunctionCase
17+
value: lower_case
18+
- key: readability-identifier-naming.VariableCase
19+
value: lower_case
20+
- key: readability-identifier-naming.EnumConstantCase
21+
value: UPPER_CASE
22+
- key: readability-identifier-naming.GlobalConstantCase
23+
- value: lower_case
24+
- key: readability-identifier-naming.ConstexprVariableCase
25+
value: lower_case
26+
- key: readability-identifier-naming.MemberConstantCase
27+
value: lower_case
28+
- key: readability-identifier-naming.MemberCase
29+
value: lower_case
30+
- key: readability-identifier-naming.MethodCase
31+
value: lower_case

.github/workflows/build.yml

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
paths:
6+
- '**.cpp'
7+
- '**.hpp'
8+
- '**.ipp'
9+
- '**.cmake'
10+
- '**.cmake.in'
11+
- '**/CMakeLists.txt'
12+
- '.github/workflows/build.yml'
13+
- 'sonar-project.properties'
14+
- 'CMakePresets.json'
15+
16+
jobs:
17+
build:
18+
name: ${{ matrix.config.name }}
19+
runs-on: ${{ matrix.config.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
config:
24+
- {
25+
name: 'Windows/2022/MSVC',
26+
os: windows-2022,
27+
build-type: 'Release',
28+
parallel: 1,
29+
}
30+
- {
31+
name: 'MacOSX/11/AppleClang',
32+
os: macos-11,
33+
build-type: 'Debug',
34+
parallel: 3,
35+
}
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
40+
- name: Configure CMake
41+
run: cmake --preset default -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }}
42+
43+
- name: Build
44+
run: cmake --build --preset default --config ${{ matrix.config.build-type }} --parallel ${{ matrix.config.parallel }}
45+
46+
- name: Test
47+
run: build/test/${{ matrix.config.build-type }}/lambda-tuple-test
48+
shell: bash
49+
50+
51+
gcc-build:
52+
name: 'Ubuntu/20.04/GCC'
53+
runs-on: ubuntu-20.04
54+
env:
55+
CMAKE_EXTRA_ARGS: '-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold'
56+
57+
steps:
58+
- name: Install gcovr
59+
run: sudo apt-get install gcovr
60+
61+
- uses: actions/checkout@v2
62+
with:
63+
# Disabling shallow clone is recommended for improving relevancy of sonarsource reporting
64+
fetch-depth: 0
65+
66+
- name: GCC 10 Configure CMake
67+
run: cmake --preset default -DCMAKE_CXX_COMPILER=$(which g++-10) -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DLAMBDA_TUPLE_TEST_COVERAGE=on -DLAMBDA_TUPLE_GCOV_PROGRAM=$(which gcov-10) -DLAMBDA_TUPLE_COVERAGE_OUTPUT_FILE=${{ github.workspace }}/build/sonarqube-coverage.xml ${{ env.CMAKE_EXTRA_ARGS }} -DCMAKE_BUILD_TYPE=Debug
68+
69+
- name: GCC 10 Build
70+
run: cmake --build --preset default --parallel $(nproc)
71+
72+
- name: GCC 10 Test
73+
run: build/test/lambda-tuple-test
74+
75+
- name: GCC 10 Install
76+
run: cmake --install build --prefix build/out
77+
78+
- name: GCC 10 Coverage
79+
run: cmake --build ${{ github.workspace }}/build --config Debug --target lambda-tuple-test-coverage
80+
81+
- name: Download sonar-scanner
82+
uses: warchant/setup-sonar-scanner@v3
83+
with:
84+
version: 4.7.0.2747
85+
86+
- name: Run sonar-scanner
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
run: |
90+
sonar-scanner \
91+
-Dsonar.cfamily.compile-commands=${{ github.workspace }}/build/compile_commands.json \
92+
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
93+
-Dsonar.coverageReportPaths=${{ github.workspace }}/build/sonarqube-coverage.xml
94+
95+
96+
clang-build:
97+
name: 'Ubuntu/20.04/Clang'
98+
runs-on: ubuntu-20.04
99+
env:
100+
TRIPLET: 'x64-linux-clang-release'
101+
CMAKE_EXTRA_ARGS: '"-DCMAKE_CXX_FLAGS=-stdlib=libc++ -stdlib++-isystem /usr/lib/llvm-10/include/c++/v1/ -Wno-unused-command-line-argument" -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld'
102+
103+
- uses: actions/checkout@v2
104+
105+
- name: Clang 10 Configure CMake
106+
run: cmake --preset default -DCMAKE_CXX_COMPILER=$(which clang++-10) ${{ env.CMAKE_EXTRA_ARGS }} -DCMAKE_BUILD_TYPE=Release
107+
108+
- name: Clang 10 Build
109+
run: cmake --build --preset default --config Release --parallel $(nproc)
110+
111+
- name: Clang 10 Test
112+
run: build/test/lambda-tuple-test

.gitignore

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app
33+
34+
# Visual Studio
35+
*.db
36+
/project/msvc/
37+
/tests/project/msvc/
38+
.vs
39+
CMakeSettings.json
40+
41+
# Visual Studio Code
42+
.vscode
43+
cmake-variants.yaml
44+
CMakeUserPresets.json
45+
46+
# Codeblocks
47+
*.layout
48+
*.depend
49+
50+
# QT Creator
51+
*.user
52+
*.autosave
53+
54+
# Clion
55+
.idea/
56+
.clion.source.upload.marker
57+
58+
# Gedit backup files
59+
*.txt~
60+
*.cmake~
61+
*.cpp~
62+
*.h~
63+
*.hpp~
64+
65+
# Build folders
66+
/*build*/
67+
68+
# SonarQube
69+
sonar-cfamily-reproducer.zip
70+
.scannerwork
71+
72+
# https://github.com/aras-p/ClangBuildAnalyzer
73+
ClangBuildAnalyzer.ini

0 commit comments

Comments
 (0)