レシピ
bca と bca-web で作業を進めるためのタスク指向の例です。各レシピは、バイナリがビルド済み(cargo build --release)で、bca が PATH 上にあることを前提とします。
レシピは目的別にまとめられています:
- Quality reports: generate Markdown reports for pull requests, dashboards, or wikis, including the C/C++ preprocessor-aware workflow.
- CI integration: wire
bca checkandbca reportinto GitHub Actions and GitLab CI, including the baseline / ratchet pattern and the Code Quality widget path. - Baselines: record existing offenders in a
.bca-baseline.tomlso the gate only fires on new or worsened violations, and audit or diff that baseline during review. - Local threshold gates: mirror the CI threshold gate on a developer machine with a two-tier (hard + headroom) Makefile /
just/pre-commitpattern, so regressions never reach the pull request. - Choosing thresholds: learn where the shipped defaults come from, choose language-specific overrides, and select limits for CI, agent feedback, legacy triage, or safety-critical work.
- Feeding metrics to an agent: wire
bca checkinto an agentic coding tool’s after-edit feedback loop (Claude CodePostToolUsehook, OpenCode plugin), with the anti-gaming guidance that keeps the loop honest. - AST queries: search for syntactic constructs, count node types, dump trees, and detect parse errors.
- Exporting metric data: emit structured output (JSON / YAML / TOML / CBOR) and consume it from shell pipelines.
- Driving the REST API: run the HTTP server and call every endpoint with
curl.
For a deeper look at any flag the recipes use, see the per-command pages under Commands. For the full list of metrics that show up in these recipes, see Supported Metrics.
Upstream reference.
big-code-analysisis a fork of Mozilla’srust-code-analysis. Recipes that work for the upstreamrust-code-analysis-clibinary usually translate directly: replace the binary name and adjust for the subcommand restructure documented in the migration guide.