diff --git a/.github/workflows/dry-run.yml b/.github/workflows/dry-run.yml index 2db61c17e..6c6d67da7 100644 --- a/.github/workflows/dry-run.yml +++ b/.github/workflows/dry-run.yml @@ -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: diff --git a/Makefile.cbm b/Makefile.cbm index c2ababbcb..b86dd095a 100644 --- a/Makefile.cbm +++ b/Makefile.cbm @@ -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 \