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
31 changes: 31 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Checks: >
clang-diagnostic-*,
clang-analyzer-*,
cppcoreguidelines-*,
modernize-*,
performance-*,
readability-*,
-modernize-use-trailing-return-type,
-readability-magic-numbers,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-union-access

WarningsAsErrors: ""

CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.ConstantCase
value: CamelCase
- key: readability-identifier-naming.ConstantPrefix
value: "k"
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.MemberSuffix
value: "_"
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,36 @@ jobs:
- name: Test
run: ./build/hosted/tests/system_test --gtest_color=yes

clang-tidy:
name: clang-tidy static analysis
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install system dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y ninja-build clang-tidy

- name: Install CMake 4.x
run: pip install cmake --quiet

- name: Configure
run: |
cmake -S . -B build/hosted \
-DENABLE_TESTS=ON \
-DHARDWARE_DIRECTORY="" \
-G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_CLANG_TIDY=ON

- name: Build (runs clang-tidy)
run: cmake --build build/hosted --target system_test

batterycase-build:
name: BatteryCase Controller firmware build (ARM Cortex-M4)
runs-on: ubuntu-latest
Expand Down
Loading