feat(clang): add claude suggestion

This commit is contained in:
2025-09-09 11:11:53 +08:00
parent cfc13ff82c
commit d5350c35a8
9 changed files with 360 additions and 1 deletions

29
scripts/run-linter.sh Normal file → Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
# 本地執行 linter 的腳本
echo "Running clang-tidy on C++ files..."
# 檢查 clang-tidy 是否存在
if ! command -v clang-tidy &> /dev/null; then
echo "clang-tidy not found. Please install it first."
echo "Ubuntu/Debian: sudo apt install clang-tidy"
echo "macOS: brew install llvm"
exit 1
fi
# 尋找所有 C++ 檔案
CPP_FILES=$(find src tests -name "*.cpp" -o -name "*.h" 2>/dev/null)
if [ -z "$CPP_FILES" ]; then
echo "No C++ files found."
exit 0
fi
echo "Found files:"
echo "$CPP_FILES"
echo
# 執行 clang-tidy
echo "$CPP_FILES" | xargs clang-tidy --config-file=.clang-tidy
echo "Linter check completed."