Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Update cpp template to version 0.3.3 #2

Merged
merged 6 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 48 additions & 36 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BasedOnStyle: LLVM

---
Language: Cpp
BasedOnStyle: LLVM
#BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Right
Expand Down Expand Up @@ -32,16 +32,18 @@ AlignConsecutiveMacros:
AlignCompound: false
PadOperators: false
AlignEscapedNewlines: Right
AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
Expand All @@ -53,52 +55,48 @@ AttributeMacros:
- DPLX_ATTR_NO_UNIQUE_ADDRESS
BinPackArguments: true
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterClass: true
AfterControlStatement: Always
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterEnum: true
AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterAttributes: Leave
BreakAfterJavaFieldAnnotations: true
BreakArrays: false
BreakBeforeBinaryOperators: All
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Allman
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeComma
BreakBeforeBraces: Custom
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakInheritanceList: BeforeComma
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Right
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: Never
# deprecated, replaced by PackConstructorInitializers
#ConstructorInitializerAllOnOneLineOrOnePerLine: true
#AllowAllConstructorInitializersOnNextLine: false
FixNamespaceComments: true
ForEachMacros:
- foreach
Expand All @@ -125,20 +123,29 @@ IncludeCategories:
IncludeIsMainRegex: '(\.test|-tests)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: NoIndent
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: NoIndent
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: true
InsertNewlineAtEOF: true
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 8
BinaryMinDigits: 9
Decimal: 3
DecimalMinDigits: 5
Hex: 4
HexMinDigits: 5
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
LambdaBodyIndentation: Signature
LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
Expand All @@ -148,6 +155,7 @@ ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: Never
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
Expand All @@ -156,22 +164,26 @@ PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
PPIndentWidth: -1
QualifierAlignment: Right
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveSemicolon: false # TODO: evaluate
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseInsensitive
SortJavaStaticImport: Before
SortUsingDeclarations: true
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
Expand All @@ -188,8 +200,8 @@ SpaceBeforeParensOptions: # this is ignored due to SpaceBeforeParens != "Custom"
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
Expand All @@ -202,16 +214,16 @@ SpacesInLineCommentPrefix:
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
StatementAttributeLikeMacros:
StatementMacros:
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
...

6 changes: 3 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Changes here will be overwritten by Copier
_commit: v0.3.1
_commit: v0.3.3
_src_path: gh:deeplex/copier-cpp
email: [email protected]
full_name: Henrik Gaßmann
header_config: false
header_config: true
header_only: false
namespace: vefs
project_name: vefs
project_slug: vefs
workaround_header: false
workaround_header: true
year: 2017-2023
64 changes: 0 additions & 64 deletions .devcontainer/Dockerfile

This file was deleted.

4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "C++",
"build": {
"dockerfile": "Dockerfile"
},
"image": "ghcr.io/deeplex/devcontainer-cpp:ubuntu-22.04",
"customizations": {
"vscode": {
"extensions": [
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# style: Reformat sources with clang-format v16
f00b51e62fefccd752a2d1ce13e947105ffed370
49 changes: 30 additions & 19 deletions .github/workflows/cpp-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,24 @@ jobs:
os: [ubuntu-22.04, windows-2022]
compiler: [gcc, clang, msvc]
exclude:
- os: windows-2022
compiler: gcc
- os: ubuntu-22.04
compiler: msvc
- os: windows-2022
compiler: gcc
include:
- os: ubuntu-22.04
triplet: x64-linux
install: |
sudo apt-get -qq update
sudo apt-get -qq install nasm
- os: ubuntu-22.04
triplet: x64-linux
compiler: clang
install: |
sudo cp tools/llvm-snapshot.gpg.key.asc /etc/apt/trusted.gpg.d/llvm-snapshot.asc
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo apt-get -qq update
sudo apt-get -qq -y install clang-16 nasm
- os: windows-2022
triplet: x64-windows

Expand All @@ -38,23 +49,20 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: '>=1.20.7'
- name: Install nasm (boringSSL build dependency)
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
run: |
sudo apt-get -qq update
sudo apt-get -qq install nasm

- name: Install required packages / compilers
if: ${{ matrix.install }}
run: ${{ matrix.install }}

- uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.6

- name: Initialize vcpkg
uses: lukka/run-vcpkg@v10
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
vcpkgGitCommitId: f6a5d4e8eb7476b8d7fc12a56dff300c1c986131
prependedCacheKey: compiler=${{ matrix.compiler }}
#appendedCacheKey: r00
vcpkgGitCommitId: a42af01b72c28a8e1d7b48107b33e4f286a55ef6

- name: Build ${{ matrix.triplet }}-${{ matrix.compiler }} preset
uses: lukka/run-cmake@v10
Expand Down Expand Up @@ -90,12 +98,17 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: "Install clang-tools-15"
- name: Install go (boringSSL build dependency)
uses: actions/setup-go@v4
with:
go-version: '>=1.20.7'

- name: "Install clang-tools-16"
run: |
sudo cp ${{ github.workspace }}/tools/llvm-snapshot.gpg.key.asc /etc/apt/trusted.gpg.d/llvm-snapshot.asc
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo apt-get -qq update
sudo apt-get -qq -y install clang-15 clang-tidy-15 clang-format-15
sudo apt-get -qq -y install clang-16 clang-tidy-16 clang-format-16 nasm

- name: Install go (boringSSL build dependency)
uses: actions/setup-go@v4
Expand All @@ -111,12 +124,10 @@ jobs:
cmakeVersion: 3.22.6

- name: Initialize vcpkg
uses: lukka/run-vcpkg@v10
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: ${{ github.workspace }}/../vcpkg
vcpkgGitCommitId: f6a5d4e8eb7476b8d7fc12a56dff300c1c986131
prependedCacheKey: compiler=clang-15
#appendedCacheKey: r00
vcpkgGitCommitId: a42af01b72c28a8e1d7b48107b33e4f286a55ef6

- name: Configure x64-linux-clang preset
uses: lukka/run-cmake@v10
Expand All @@ -129,7 +140,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: 15.0.7
version: 16.0.6
style: file # use .clang-format settings
tidy-checks: '' # use .clang-tidy settings
extensions: cpp,hpp
Expand Down
Loading
Loading