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
36 changes: 36 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
Language: Cpp
Standard: c++20
BasedOnStyle: LLVM

IndentWidth: 4
TabWidth: 4
NamespaceIndentation: All
AccessModifierOffset: -4

ColumnLimit: 120

PenaltyReturnTypeOnItsOwnLine: 1000

BinPackParameters: false
BinPackArguments: false
AlignAfterOpenBracket: BlockIndent

AllowShortFunctionsOnASingleLine: None
InsertBraces: true
AllowShortLambdasOnASingleLine: Empty

BreakConstructorInitializers: AfterColon
PackConstructorInitializers: CurrentLine

PointerAlignment: Left
ReferenceAlignment: Left

SpaceAfterTemplateKeyword: false
AlwaysBreakTemplateDeclarations: No

SortIncludes: Never

AlignTrailingComments:
Kind: Always
OverEmptyLines: 2
55 changes: 55 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Checks: >
readability-identifier-naming,
readability-implicit-bool-conversion,
misc-const-correctness,
-clang-diagnostic-error

CheckOptions:
- key: readability-identifier-naming.ClassCase
value: lower_case
- key: readability-identifier-naming.StructCase
value: lower_case

- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.MethodCase
value: lower_case
- key: readability-identifier-naming.MethodIgnoredRegexp
value: '^[A-Z][A-Z0-9_]*$'

- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.VariableIgnoredRegexp
value: '^[A-Z][A-Z0-9_]*$'
- key: readability-identifier-naming.LocalVariableCase
value: lower_case
- key: readability-identifier-naming.ParameterCase
value: lower_case

- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.MemberIgnoredRegexp
value: '^([A-Z][A-Z0-9_]*|[a-z][a-z0-9_]*_)$'
- key: readability-identifier-naming.PrivateMemberSuffix
value: '_'
- key: readability-identifier-naming.ProtectedMemberSuffix
value: '_'
- key: readability-identifier-naming.ConstantMemberIgnoredRegexp
value: '^[A-Z][A-Z0-9_]*$'

- key: readability-identifier-naming.EnumConstantCase
value: CamelCase

- key: readability-identifier-naming.EnumCase
value: lower_case

- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase

- key: readability-identifier-naming.NamespaceCase
value: lower_case

- key: readability-identifier-naming.TypeAliasCase
value: lower_case
- key: readability-identifier-naming.TypeAliasIgnoredRegexp
value: '^[A-Z]$'
30 changes: 29 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,38 @@ jobs:
alert-threshold: '150%'
fail-on-alert: true

clang-format:
name: Clang Format
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: |
find include tests -name "*.h" -o -name "*.cpp" | \
xargs clang-format --dry-run --Werror

clang-tidy:
name: Clang Tidy
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Install Clang-Tidy 19
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y clang-tidy-19
- name: Check tidy
run: |
find include -name "*.h" -o -name "*.cpp" | \
xargs -I{} clang-tidy-19 {} -- -x c++ -std=c++20 -I include -include cstdint -include cstddef

all-checks:
name: All Checks
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: [unittests]
needs: [unittests, clang-format, clang-tidy]
steps:
- run: echo "All checks passed"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ install/
*.tlog
*.user
*.iml
*.xml
*.xml
*.bat
Loading
Loading