89 lines
3.7 KiB
Markdown
89 lines
3.7 KiB
Markdown
# Development
|
|
|
|
The project uses Rust edition 2024 and requires Rust 1.98.1 or newer. The
|
|
committed lockfile makes application builds reproducible. Linux is the supported
|
|
and exercised platform; other platforms are not declared supported until CI
|
|
covers them. Jenkins checks Linux on both Rust 1.98.1 (the MSRV) and current
|
|
stable, with all features and without default features.
|
|
|
|
## Quality gates
|
|
|
|
Run the same core checks required by the contributor guide:
|
|
|
|
```sh
|
|
cargo fmt --all -- --check
|
|
cargo clippy --locked --all-targets --all-features -- -D warnings
|
|
cargo test --locked --all-targets --all-features
|
|
cargo test --locked --all-targets --no-default-features
|
|
cargo doc --locked --no-deps --all-features
|
|
cargo audit --deny warnings
|
|
cargo deny --locked check
|
|
```
|
|
|
|
The default `fancy-diagnostics` feature enables the detector's colored Miette
|
|
renderer and default output mode. The no-default-features test run ensures the
|
|
shared library and all binaries remain valid with the plain fallback. Focused
|
|
unit and integration tests cover domain invariants, input failures, archives,
|
|
CLI exit behavior, and feature configurations.
|
|
|
|
CI runs the executable fixture manifest and Insta CLI snapshots explicitly in
|
|
addition to the full suite. `cargo-audit` rejects RustSec advisories and yanked
|
|
packages. [`deny.toml`](../deny.toml) rejects unknown dependency sources,
|
|
wildcard versions, and licenses outside the reviewed allow-list; duplicate
|
|
versions are reported for review while upstream compatibility is assessed.
|
|
|
|
Insta snapshots are reserved for stable user-facing text such as CLI help and
|
|
usage errors. Structured domain values use direct assertions so failures remain
|
|
precise and easy to review. Accept snapshot changes only after inspecting the
|
|
generated diff.
|
|
|
|
## Coverage and badges
|
|
|
|
Run line coverage with Cargo Tarpaulin:
|
|
|
|
```sh
|
|
cargo tarpaulin --config tarpaulin.toml
|
|
```
|
|
|
|
The configuration enforces a 90% floor. The current suite measured 92.19%
|
|
(1333/1446 lines) on 2026-09-29. The remaining lines are dominated by
|
|
platform/I/O failure injection, malformed archive internals, coordinate
|
|
overflow, LSP logging/reload failures, and subprocess attribution. Do not add
|
|
brittle tests or production seams solely to make Tarpaulin count those paths.
|
|
|
|
After a clean test and coverage run, refresh the repository-local badges with:
|
|
|
|
```sh
|
|
rust_autobadges --high-coverage-percent 0.7 --mid-coverage-percent 0.3
|
|
```
|
|
|
|
Commit `badges/*.svg` and `.run_status.toml`; do not commit the generated
|
|
`tarpaulin-report.html`. Jenkins runs both feature configurations and enforces
|
|
the Tarpaulin floor before building release binaries.
|
|
|
|
## Test scope
|
|
|
|
Add behavior tests at the lowest useful layer and an integration test when a
|
|
change crosses a binary boundary. Important edge cases include malformed input,
|
|
invalid UTF-8, empty text, Unicode byte spans, deterministic ordering, archive
|
|
limits, and near misses for detection rules. The detailed expectations and
|
|
task-level commit discipline are in [AGENTS.md](../AGENTS.md).
|
|
|
|
Each completed milestone receives an immutable annotated `milestone-N` Git tag
|
|
after its acceptance criteria and quality gates pass.
|
|
|
|
## Fuzzing
|
|
|
|
The standalone [`fuzz`](../fuzz/) package contains five `cargo-fuzz` targets and
|
|
reviewed seeds for configuration merging, rule validation/compilation, UTF-8
|
|
span conversion, replacement invariants, and hostile archive bytes. See its
|
|
README for invocation. Fuzz artifacts remain ignored until a failure has been
|
|
minimized and promoted to a normal regression test.
|
|
|
|
## Benchmarks
|
|
|
|
Run `cargo bench --locked --bench core` for the large-document, many-file,
|
|
rule-scaling, and archive-limit workloads described in
|
|
[Performance benchmarks](benchmarks.md). Benchmark reports are local artifacts;
|
|
only methodology and contextualized measurements belong in version control.
|