Skip to content
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
89 changes: 89 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
Language: Cpp
# AccessModifierOffset: -2
# AlignAfterOpenBracket: Align
# AlignConsecutiveAssignments: false
# AlignConsecutiveDeclarations: false
# AlignEscapedNewlinesLeft: false
# AlignOperands: true
# AlignTrailingComments: true
# AllowAllParametersOfDeclarationOnNextLine: true
# AllowShortBlocksOnASingleLine: false
# AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
# AllowShortIfStatementsOnASingleLine: false
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
# BinPackArguments: true
# BinPackParameters: true
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: false
BeforeCatch: false
BeforeElse: true
IndentBraces: false
#BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 200
# CommentPragmas: '^ IWYU pragma:'
# ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 0
# ContinuationIndentWidth: 4
# Cpp11BracedListStyle: true
# DerivePointerAlignment: false
# DisableFormat: false
# ExperimentalAutoDetectBinPacking: false
# ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
# IncludeCategories:
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
# Priority: 2
# - Regex: '^(<|"(gtest|isl|json)/)'
# Priority: 3
# - Regex: '.*'
# Priority: 1
# IndentCaseLabels: false
# IndentWidth: 2
# IndentWrappedFunctionNames: false
# KeepEmptyLinesAtTheStartOfBlocks: true
# MacroBlockBegin: ''
# MacroBlockEnd: ''
# MaxEmptyLinesToKeep: 1
# NamespaceIndentation: None
# ObjCBlockIndentWidth: 2
# ObjCSpaceAfterProperty: false
# ObjCSpaceBeforeProtocolList: true
# PenaltyBreakBeforeFirstCallParameter: 19
# PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: 120
# PenaltyBreakString: 1000
# PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 100
PointerAlignment: Left
# ReflowComments: true
SortIncludes: true
# SpaceAfterCStyleCast: false
# SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
SpaceAfterTemplateKeyword: true
Standard: c++20
TabWidth: 2
UseTab: Never
...
56 changes: 56 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
Checks: "-abseil-*,
bugprone-*,
-boost-*,
-cert-*,
clang-diagnostic-*,
-clang-diagnostic-documentation,
clang-analyzer-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-magic-numbers,
-darwin-*,
-fuchsia-*,
-google-*,
-hicpp-*,
-linuxkernel-*,
-llvm-*,
misc-*,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
-modernize-use-auto,
-mpi-*,
-objc-*,
-openmp-*,
performance-*,
-portability-*,
readability-*,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-uppercase-literal-suffix,
-readability-magic-numbers"
WarningsAsErrors: '*'
HeaderFilterRegex: 'simplnx/.*\.hpp'
FormatStyle: file
CheckOptions:
cppcoreguidelines-macro-usage.AllowedRegexp: 'SIMPLNX_EXPORT|SIMPLNX_NO_EXPORT|SIMPLNX_DEPRECATED'
readability-identifier-naming.IgnoreMainLikeFunctions: 'false'
readability-identifier-naming.PrivateMemberPrefix: 'm_'
readability-identifier-naming.NamespaceCase: lower_case
readability-identifier-naming.ClassCase: CamelCase
readability-identifier-naming.ClassMethodCase: camelBack
readability-identifier-naming.PrivateMember: CamelCase
readability-identifier-naming.PublicMemberCase: CamelCase
readability-identifier-naming.StructCase: CamelCase
readability-identifier-naming.FunctionCase: camelBack
readability-identifier-naming.VariableCase: camelBack
readability-identifier-naming.GlobalVariableCase: CamelCase
readability-identifier-naming.GlobalConstantCase: CamelCase
readability-identifier-naming.GlobalConstantPrefix: 'k_'
readability-identifier-naming.GlobalFunctionCase: CamelCase
readability-identifier-naming.LocalPointerCase: camelBack
readability-identifier-naming.LocalPointerSuffix: 'Ptr'
readability-identifier-naming.TypeAliasCase: CamelCase
readability-identifier-naming.TypeAliasSuffix: 'Type'
readability-identifier-naming.MacroDefinitionCase: UPPER_CASE
...
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto

*.bat text eol=crlf
*.sh text eol=lf
64 changes: 64 additions & 0 deletions .github/workflows/asan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: asan

on:
schedule:
- cron: '15 5 * * *'

jobs:
build:
env:
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
CC: clang-17
CXX: clang++-17
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx myst-parser sphinx-markdown-tables sphinx_rtd_theme numpy
- name: Add C++ Problem Matcher
uses: ammaraskar/gcc-problem-matcher@0.2.0
- name: Install Dependencies
run: |
sudo apt-get -y install ninja-build
- name: Install mono
shell: bash
run: |
sudo apt-get -y install ca-certificates gnupg
sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt-get -y update
sudo apt-get -y install mono-complete
- name: Setup NuGet Credentials
shell: bash
run: |
mono `vcpkg fetch nuget | tail -n 1` \
sources add \
-source "https://nuget.pkg.github.com/BlueQuartzSoftware/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "BlueQuartzSoftware" \
-password "${{secrets.GITHUB_TOKEN}}"
mono `vcpkg fetch nuget | tail -n 1` \
setapikey "${{secrets.GITHUB_TOKEN}}" \
-source "https://nuget.pkg.github.com/BlueQuartzSoftware/index.json"
- name: Configure
run: |
cmake --preset ci-asan ${{github.workspace}}
- name: Build
run: |
export LD_LIBRARY_PATH=$(dirname $($CXX -print-file-name=libclang_rt.asan-x86_64.so))
cmake --build --preset ci-asan
- name: Test
run: |
export LD_PRELOAD=$($CXX -print-file-name=libclang_rt.asan-x86_64.so)
export LSAN_OPTIONS=suppressions=${{github.workspace}}/utilities/leak_suppressions.txt
ctest --preset ci-asan
33 changes: 33 additions & 0 deletions .github/workflows/format_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: clang-format pr

on:
pull_request:
branches:
- develop
- master

jobs:
clang_format_pr:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Add Problem Matcher
uses: ammaraskar/gcc-problem-matcher@a141586609e2a558729b99a8c574c048f7f56204
- name: Check Formatting
id: check_format
continue-on-error: true
run: |
python3 scripts/clang_format.py --format-version 13 --commits HEAD^ HEAD
- name: Apply Formatting
if: steps.check_format.outcome != 'success'
run: |
python3 scripts/clang_format.py --format-version 13 --modify --commits HEAD^ HEAD
- name: Add Suggestions
if: steps.check_format.outcome != 'success'
uses: reviewdog/action-suggester@v1
with:
tool_name: clang-format
fail_level: error
19 changes: 19 additions & 0 deletions .github/workflows/format_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: clang-format

on:
push:
branches:
- develop
- master

jobs:
clang_format:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- name: Add Problem Matcher
uses: ammaraskar/gcc-problem-matcher@a141586609e2a558729b99a8c574c048f7f56204
- name: Check Formatting
run: |
python3 scripts/clang_format.py --format-version 13
76 changes: 76 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: linux

on:
pull_request:
branches:
- develop
- master
push:
branches:
- develop
- master

jobs:
build:
env:
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
cxx:
- g++-11
- clang++-14
include:
- cxx: g++-11
cc: gcc-11
- cxx: clang++-14
cc: clang-14
runs-on: ${{matrix.os}}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx myst-parser sphinx-markdown-tables sphinx_rtd_theme numpy
- name: Add C++ Problem Matcher
uses: ammaraskar/gcc-problem-matcher@0.2.0
- name: Install Dependencies - 2
run: |
sudo apt-get -y install ninja-build
- name: Install Sphinx
run: |
sudo pip3 install sphinx myst-parser sphinx-markdown-tables sphinx_rtd_theme numpy
- name: Setup NuGet Credentials
shell: bash
run: |
mono `vcpkg fetch nuget | tail -n 1` \
sources add \
-source "https://nuget.pkg.github.com/BlueQuartzSoftware/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "BlueQuartzSoftware" \
-password "${{secrets.GITHUB_TOKEN}}"
mono `vcpkg fetch nuget | tail -n 1` \
setapikey "${{secrets.GITHUB_TOKEN}}" \
-source "https://nuget.pkg.github.com/BlueQuartzSoftware/index.json"
- name: Configure
env:
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
run: |
cmake --preset ci-linux-x64 ${{github.workspace}}
- name: Build
run: |
cmake --build --preset ci-linux-x64
- name: Test
run: |
ctest --preset ci-linux-x64
Loading
Loading