mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-10-28 07:03:20 +08:00
- 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
31 lines
757 B
Bash
Executable File
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 ==="
|