crap-core 0.5.0

Language-agnostic foundation for the CRAP analyzer family — domain types, port traits, and shared invariants for crap4rs / future crap4ts.
Documentation
[package]
name = "crap-core"
version = "0.5.0"
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
description = "Language-agnostic foundation for the CRAP analyzer family — domain types, port traits, and shared invariants for crap4rs / future crap4ts."
keywords = ["crap", "complexity", "coverage", "testing", "quality"]
categories = ["development-tools::testing"]
readme = "README.md"

[lib]
name = "crap_core"
path = "src/lib.rs"

[features]
# Exposes `crap_core::test_strategies::*` (proptest generators + the
# `DummyParseDiagnostic` stub) to downstream adapter tests. Production
# builds leave this off so `proptest` is not pulled into the prod tree.
# crap4rs's `[dev-dependencies]` opts in.
test-helpers = ["dep:proptest"]

[dependencies]
# Serialization — domain types derive Serialize/Deserialize so reporters
# in crap4rs and future siblings (crap4ts) can hand them to any serde
# format without translation.
serde = { workspace = true }
# JSON envelope rendering (reporters/json + reporters/sarif), baseline
# envelope load (adapters/baseline). Relocated from crap4rs in S3.
serde_json = { workspace = true }
# Config file parsing (adapters/config). Relocated from crap4rs in S3.
toml = { workspace = true }

# Error tagging on `CrapError`, `view::CoverageRangeError`, and the
# adapter error families. Pure typed errors, no I/O.
thiserror = { workspace = true }
# anyhow::Result threads through adapters/config, adapters/diff, and
# core::walker — context propagation for IO/parse failures. Relocated
# from crap4rs in S3.
anyhow = { workspace = true }

# Filesystem walker (core::walker — relocated from crap4rs in S3).
ignore = { workspace = true }

# Hunk-header / @@-line parsing in adapters/diff (relocated from
# crap4rs in S3).
regex = { workspace = true }

# Terminal table reporter (relocated from crap4rs in S3).
comfy-table = { workspace = true }
# ANSI colorization for the terminal reporter (relocated from crap4rs
# in S3).
colored = { workspace = true }

# CLI argument parsing (cli/mod.rs — relocated from crap4rs in S4).
# `clap_complete{,_nushell}` back the `completions` subcommand. The
# concrete adapter binaries (crap4rs, future crap4ts) consume `cli::run`
# but do not invoke clap themselves; clap lives here so cli/mod.rs
# stays self-contained after the relocation.
clap = { workspace = true }
clap_complete = { workspace = true }
clap_complete_nushell = { workspace = true }

# Glob matching for per-path threshold overrides — used by
# `core::ThresholdResolver` (relocated from crap4rs in S4). Pure data
# match logic; satisfies AST-purity.
globset = { workspace = true }

# Compile-time templates for `adapters::reporters::{html, markdown}`
# (crap-rs#260). Templates live under `crates/crap-core/templates/`
# and are checked at compile time by the `#[derive(Template)]` macro.
# Pure rendering — no I/O.
askama = { workspace = true }

# Optional — only pulled in by the `test-helpers` feature. The
# `test_strategies` module imports `proptest::prelude::*`; gating it
# behind a feature keeps the prod dependency tree clean.
proptest = { workspace = true, optional = true }

[dev-dependencies]
# `proptest` powers the property tests interleaved through the domain
# modules; `pretty_assertions` improves diff output.
proptest = { workspace = true }
pretty_assertions = { workspace = true }
# Adapter tests construct temp dirs / files for baseline + diff +
# walker fixtures.
tempfile = { workspace = true }

# Cross-crate binary invocation: tests/wire_envelope_snapshot.rs runs
# the crap4rs binary across crate boundaries. `env!("CARGO_BIN_EXE_*")`
# is only set for tests inside the bin's own crate, so assert_cmd's
# workspace-aware `Command::cargo_bin("crap4rs")` is required.
assert_cmd = { workspace = true }
insta = { workspace = true }