mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08:00
feat: add C++ language support and hook tests (#539)
- agents: cpp-build-resolver, cpp-reviewer - commands: cpp-build, cpp-review, cpp-test - rules: cpp/ (coding-style, hooks, patterns, security, testing) - tests: 9 new hook test files with comprehensive coverage Cherry-picked from PR #436.
This commit is contained in:
39
rules/cpp/hooks.md
Normal file
39
rules/cpp/hooks.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
paths:
|
||||
- "**/*.cpp"
|
||||
- "**/*.hpp"
|
||||
- "**/*.cc"
|
||||
- "**/*.hh"
|
||||
- "**/*.cxx"
|
||||
- "**/*.h"
|
||||
- "**/CMakeLists.txt"
|
||||
---
|
||||
# C++ Hooks
|
||||
|
||||
> This file extends [common/hooks.md](../common/hooks.md) with C++ specific content.
|
||||
|
||||
## Build Hooks
|
||||
|
||||
Run these checks before committing C++ changes:
|
||||
|
||||
```bash
|
||||
# Format check
|
||||
clang-format --dry-run --Werror src/*.cpp src/*.hpp
|
||||
|
||||
# Static analysis
|
||||
clang-tidy src/*.cpp -- -std=c++17
|
||||
|
||||
# Build
|
||||
cmake --build build
|
||||
|
||||
# Tests
|
||||
ctest --test-dir build --output-on-failure
|
||||
```
|
||||
|
||||
## Recommended CI Pipeline
|
||||
|
||||
1. **clang-format** — formatting check
|
||||
2. **clang-tidy** — static analysis
|
||||
3. **cppcheck** — additional analysis
|
||||
4. **cmake build** — compilation
|
||||
5. **ctest** — test execution with sanitizers
|
||||
Reference in New Issue
Block a user