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
121 changes: 121 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Auto-generated from cpp-library (https://github.com/stlab/cpp-library)
# Do not edit this file directly - it will be overwritten when templates are regenerated

# Format style options described here:
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html

# Many of the alignment and single line changes were made to facilitate setting
# breakpoints on specific expressions.

---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: TopLevel
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: false
# BraceWrapping:
# AfterClass: true
# AfterControlStatement: false
# AfterEnum: false
# AfterFunction: false
# AfterNamespace: false
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
# AfterExternBlock: false
# BeforeCatch: false
# BeforeElse: false
# IndentBraces: false
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 100
CommentPragmas: "^ IWYU pragma:"
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: ".*"
Priority: 1
IncludeIsMainRegex: "$"
IndentCaseLabels: true
IndentPPDirectives: None # Other option is AfterHash, which indents top level includes as well
IndentWidth: 4
IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17
TabWidth: 4
UseTab: Never
---
Language: Cpp
---
Language: ObjC
PointerAlignment: Right
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Checks: '-*,clang-analyzer-*'
WarningsAsErrors: '*'
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Auto-generated from cpp-library (https://github.com/stlab/cpp-library)
# Do not edit this file directly - it will be overwritten when templates are regenerated

# Auto detect text files and perform LF normalization
* text=auto
128 changes: 128 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Adapted from cpp-library's CI template.

name: CI

on:
push:
branches: [main, feat/f64-port]
pull_request:
branches: [main]
release:
types: [published]

permissions:
contents: read

jobs:
test:
name: Test (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu GCC
os: ubuntu-latest
cc: gcc
cxx: g++
- name: Ubuntu Clang
os: ubuntu-latest
cc: clang
cxx: clang++
- name: macOS
os: macos-latest
- name: Windows
os: windows-latest

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v7
- if: ${{ startsWith(matrix.os, 'windows') }}
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756

- name: Configure CMake
run: cmake --preset=test
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
if: ${{ matrix.cc }}

- name: Configure CMake
run: cmake --preset=test
if: ${{ !matrix.cc }}

- name: Build
run: cmake --build --preset=test

- name: Test
run: ctest --preset=test

- name: Build and Install
run: |
cmake --preset=default
cmake --build --preset=default
cmake --install build/default --prefix ${{ runner.temp }}/install
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
if: ${{ matrix.cc }}

- name: Build and Install
run: |
cmake --preset=default
cmake --build --preset=default
cmake --install build/default --prefix ${{ runner.temp }}/install
if: ${{ !matrix.cc }}

- name: Test find_package
shell: bash
run: |
# Create a minimal test to verify the installation works with find_package
mkdir -p ${{ runner.temp }}/test-find-package
cd ${{ runner.temp }}/test-find-package

# Create test CMakeLists.txt
cat > CMakeLists.txt << EOF
cmake_minimum_required(VERSION 3.20)
project(test-find-package CXX)

find_package(cel-std REQUIRED)

message(STATUS "Successfully found cel-std")
EOF

# Convert paths to forward slashes for CMake (works on all platforms)
INSTALL_PREFIX=$(echo '${{ runner.temp }}/install' | sed 's|\\|/|g')

# Test find_package with CMAKE_PREFIX_PATH
cmake -B build -S . -DCMAKE_PREFIX_PATH="${INSTALL_PREFIX}"

clang-tidy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- name: Configure CMake with clang-tidy
run: cmake --preset=clang-tidy

- name: Build with clang-tidy
run: cmake --build --preset=clang-tidy

- name: Run tests with clang-tidy
run: ctest --preset=clang-tidy

docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- name: Install Doxygen
uses: ssciwr/doxygen-install@fa3e94d34131d3990b6b8ba939ab982964aa3758

- name: Configure CMake
run: cmake --preset=docs

- name: Build Documentation
run: cmake --build --preset=docs
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/build*/
/.claude/worktrees/
/.superpowers/
/.cache/
/.clangd
/compile_commands.json
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"matepek.vscode-catch2-test-adapter",
"llvm-vs-code-extensions.vscode-clangd",
"ms-vscode.live-server",
"ms-vscode.cmake-tools"
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cmake.useCMakePresets": "always",
"cmake.configureOnOpen": true,
"cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json"
}
Loading
Loading