Skip to content

Commit bcd9310

Browse files
committed
perf: parallelize cppcheck linting
1 parent 0a6f273 commit bcd9310

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎Makefile.cbm‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,10 @@ LLVM_BIN := $(shell brew --prefix llvm 2>/dev/null)/bin
11091109
CLANG_TIDY ?= $(shell [ -x "$(LLVM_BIN)/clang-tidy" ] && echo "$(LLVM_BIN)/clang-tidy" || echo clang-tidy)
11101110
CLANG_FORMAT ?= $(shell [ -x "$(LLVM_BIN)/clang-format" ] && echo "$(LLVM_BIN)/clang-format" || echo clang-format)
11111111
CPPCHECK ?= cppcheck
1112+
# Cppcheck is the long pole in the CI lint gate. Its own worker pool is safer
1113+
# than partitioning LINT_SRCS across separate invocations because diagnostics,
1114+
# suppressions, and include configuration remain identical in one run.
1115+
CPPCHECK_JOBS ?= 8
11121116

11131117
# macOS SDK sysroot (needed for Homebrew LLVM to find system headers)
11141118
SYSROOT = $(shell xcrun --show-sdk-path 2>/dev/null)
@@ -1136,7 +1140,8 @@ lint-tidy-diff:
11361140
# cppcheck: complementary analysis (config in .cppcheck)
11371141
lint-cppcheck:
11381142
@echo "=== cppcheck ==="
1139-
@$(CPPCHECK) --enable=warning,style,performance,portability \
1143+
@$(CPPCHECK) -j $(CPPCHECK_JOBS) \
1144+
--enable=warning,style,performance,portability \
11401145
--std=c11 --language=c \
11411146
--suppressions-list=.cppcheck \
11421147
--error-exitcode=1 \

‎scripts/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ codes) and rejects unknown flags with exit 2 + `Please consult --help.`
2121
| **package wrappers** | `ci/test-package-wrappers.sh` | Go, npm, and PyPI runtime-set publication/lock suites on the current host. CI runs the same entry on Linux and Windows so both platform lock implementations gate. |
2222
| **build** | `build.sh` | CLEAN production runtime set (native executable + authenticated integration asset; `--with-ui` adds one content-addressed UI pack). ccache via `env.sh` makes repeats fast; `CCACHE_COMPILERCHECK=content` guarantees a hit is byte-identical to a cold compile — never stale. `--version`, `STATIC=1`, `BUILD_DIR=`. |
2323
| **build-dev** | `build-dev.sh` | Incremental local production build. Make dependency files plus ccache rebuild only changed or stale translation units; use `build.sh` for CI/release clean builds. |
24-
| **lint** | `lint.sh` | clang-tidy + cppcheck + clang-format (+ no-skips policy). `--ci` = the CI gate set (no clang-tidy). Drives the same make targets as `make lint`/`lint-ci`. |
24+
| **lint** | `lint.sh` | clang-tidy + parallel Cppcheck + clang-format (+ no-skips policy). `--ci` = the CI gate set (no clang-tidy). Drives the same make targets as `make lint`/`lint-ci`; override Cppcheck workers with `CPPCHECK_JOBS=1..N`. |
2525
| **smoke (unix)** | `smoke-local.sh` | Stages a full release fixture, serves it on a kernel-assigned port, runs `smoke-test.sh` (CLI invariants plus release install round-trip) inside a disposable HOME/XDG/TMP sandbox. `ui` variant makes a missing verified UI pack a FAILURE. `CBM_SMOKE_ARTIFACT_DIR` = smoke an extracted release artifact verbatim (release mode). |
2626
| **smoke (windows)** | `../test-infrastructure/vm/vm-smoke.sh` | Same verified runtime-set contract on the real Windows VM, plus the user-PATH registry guard (prepare/verify/cleanup). |
2727
| **smoke-invariants** | `smoke-invariants.sh` | Production-path CLI resilience battery (public command discovery, removed-MCP rejection, index/search/snippet/coverage flow, malformed-input handling) — no fixture server or install E2E. `smoke.yml` runs an explicitly seam-enabled build on the WIDEST source matrix; release artifacts remain seam-free and use the release-shaped smoke legs above. |

0 commit comments

Comments
 (0)