Thanks for contributing.
This document defines the expected workflow for code, tests, and pull requests.
Prerequisites:
- CMake
>= 3.16 - LLVM/Clang
>= 19(20 recommended) - A C++20 compiler
Build:
./build.sh --type ReleaseIf LLVM/Clang are not auto-detected:
LLVM_DIR=/path/to/llvm/lib/cmake/llvm \
Clang_DIR=/path/to/llvm/lib/cmake/clang \
./build.sh --type ReleaseRun formatting check:
./scripts/format-check.shRun regression tests:
python3 run_test.py --analyzer ./build/stack_usage_analyzerOptional module unit tests (recommended for architectural/internal changes):
cmake -S . -B build -DBUILD_ANALYZER_UNIT_TESTS=ON
cmake --build build
cd build && ctest -R analyzer_module_unit_testsCommit subjects must follow Conventional Commits:
type(scope): subject
Allowed type values:
featfixchoredocsrefactorperfcibuildstylereverttest
Rules:
- Subject line max length: 84 characters.
- Use English for commit messages.
- Keep commits focused and atomic when possible.
A PR should include:
- A clear problem statement and solution summary.
- Behavioral impact (what changed for users/CI/API).
- Validation evidence (commands run, test results).
- Documentation updates when behavior/options/contracts change.
If relevant, include:
- Example CLI invocation
- JSON/SARIF output impact
- Notes on profile/cross-TU performance impact
When adding or refactoring features, preserve module boundaries:
src/app/AnalyzerApp.cpp: application orchestration, strategy selection, input planning.src/analyzer/*: analysis pipeline coordination, preparation, location resolution, diagnostic emission.src/analysis/*: analysis logic and findings generation.src/report/ReportSerialization.cpp: output serialization (JSON/SARIF).src/cli/ArgParser.cpp: CLI argument parsing and validation.
Why:
- Keeps analysis logic decoupled from CLI/CI concerns.
- Improves testability with narrow module responsibilities.
- Reduces regression risk by centralizing reporting and orchestration behavior.
For architecture details, see:
docs/architecture/analyzer-modules.md
- Implement analysis logic under
src/analysis/(+ header underinclude/analysis/). - Integrate the pass into pipeline/module orchestration.
- Emit diagnostics through
DiagnosticEmitter(severity, rule ID, message, CWE/confidence if applicable). - Add regression tests under
test/. - Update docs (
README, wiki/docs pages) when new behavior or options are introduced.
Current CI validates at least:
- Conventional commit format
- clang-format compliance
- build/tests/integration workflows
Before opening a PR, run local checks to reduce CI round-trips.