Files
codebase-memory-mcp/scripts/lint.sh
T
Martin Vogel 8f225a37dd Use cc (Apple Clang) on macOS, gcc on Linux — unified CI/local parity
- Add scripts/env.sh: detects true hardware arch (even under Rosetta),
  verifies compiler supports target arch, adds arch prefix on macOS
- macOS uses cc/c++ everywhere (tests + builds) — ASan works natively
- Linux uses gcc/g++ everywhere — full sanitizer support
- Remove broken CC ?= gcc-14 from Makefile (GNU Make built-in overrides it)
- Scripts accept --arch flag and CC=/CXX= overrides
2026-03-18 13:08:33 +01:00

31 lines
757 B
Bash
Executable File

#!/bin/bash
# lint.sh — Run all CI linters (clang-format + cppcheck).
#
# Usage:
# scripts/lint.sh # Default tools
# scripts/lint.sh CLANG_FORMAT=clang-format-20 # Override formatter
#
# This script is the SINGLE source of truth for CI linting.
# clang-tidy is intentionally excluded (platform-dependent, pre-commit only).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
# shellcheck source=env.sh
source "$ROOT/scripts/env.sh"
# Forward overrides from args
MAKE_ARGS=()
for arg in "$@"; do
MAKE_ARGS+=("$arg")
done
print_env "lint.sh"
# Run format and cppcheck in parallel
make -j2 -f Makefile.cbm lint-ci "${MAKE_ARGS[@]+"${MAKE_ARGS[@]}"}"
echo "=== All linters passed ==="