CI: pin clang-format-18/clang-tidy-18, suppress cppcheck cross-version false positives

This commit is contained in:
Martin Vogel
2026-03-17 23:23:17 +01:00
parent e906af9568
commit dc7bc91e84
2 changed files with 10 additions and 8 deletions
+3 -3
View File
@@ -16,16 +16,16 @@ jobs:
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y libsqlite3-dev zlib1g-dev cppcheck clang-tidy clang-format
sudo apt-get install -y libsqlite3-dev zlib1g-dev cppcheck
- name: clang-format
run: make -f Makefile.cbm lint-format
run: make -f Makefile.cbm lint-format CLANG_FORMAT=clang-format-18
- name: cppcheck
run: make -f Makefile.cbm lint-cppcheck
- name: clang-tidy
run: make -f Makefile.cbm lint-tidy
run: make -f Makefile.cbm lint-tidy CLANG_TIDY=clang-tidy-18
# ── Step 2: Unit tests (ASan + UBSan) ────────────────────────
test:
+7 -5
View File
@@ -408,11 +408,12 @@ clean-c:
# ── Linting ─────────────────────────────────────────────────────
# clang-tidy and clang-format from Homebrew LLVM (keg-only on macOS)
LLVM_BIN = $(shell brew --prefix llvm 2>/dev/null)/bin
CLANG_TIDY = $(shell [ -x "$(LLVM_BIN)/clang-tidy" ] && echo "$(LLVM_BIN)/clang-tidy" || echo clang-tidy)
CLANG_FORMAT = $(shell [ -x "$(LLVM_BIN)/clang-format" ] && echo "$(LLVM_BIN)/clang-format" || echo clang-format)
CPPCHECK = cppcheck
# clang-tidy and clang-format: use Homebrew LLVM on macOS, overridable via make args
# e.g. make lint-format CLANG_FORMAT=clang-format-18
LLVM_BIN := $(shell brew --prefix llvm 2>/dev/null)/bin
CLANG_TIDY ?= $(shell [ -x "$(LLVM_BIN)/clang-tidy" ] && echo "$(LLVM_BIN)/clang-tidy" || echo clang-tidy)
CLANG_FORMAT ?= $(shell [ -x "$(LLVM_BIN)/clang-format" ] && echo "$(LLVM_BIN)/clang-format" || echo clang-format)
CPPCHECK ?= cppcheck
# macOS SDK sysroot (needed for Homebrew LLVM to find system headers)
SYSROOT = $(shell xcrun --show-sdk-path 2>/dev/null)
@@ -442,6 +443,7 @@ lint-cppcheck:
--quiet \
--suppress=varFuncNullUB \
--suppress=intToPointerCast \
--suppress=unusedStructMember \
--suppress=nullPointerOutOfMemory \
--suppress=nullPointerArithmeticOutOfMemory \
--suppress=ctunullpointerOutOfMemory \