pub struct OutputArgs {
pub format: Vec<FormatSpec>,
pub threshold: Option<f64>,
pub strict: bool,
pub lenient: bool,
pub no_fail: bool,
pub delta_gate: bool,
pub minimal_view: bool,
pub summary: bool,
pub annotation_limit: Option<u32>,
}Fields§
§format: Vec<FormatSpec>Output format(s).
Accepts a single format (--format json) for stdout, or a comma-
separated list to fan out a single analysis pass to multiple
destinations (--format json:envelope.json,markdown:report.md).
Each entry is FORMAT (stdout) or FORMAT:FILE (write to file).
Multi-format invocations may include at most one stdout entry
(the rest must specify a file) — two stdout sinks would
interleave indistinguishably, but a single stdout sink
alongside file sinks is the shape composite CI workflows need
(e.g. markdown:scorecard.md,github-annotations where the
workflow commands are intercepted from stdout by the runner).
threshold: Option<f64>CRAP score threshold — functions above this fail the check. Defaults to the calibrated cutoff for the active complexity metric (cyclomatic and cognitive scores differ in magnitude, so the default differs per metric — see the generated config).
strict: boolUse the strict preset (tighter cutoff calibrated for the active metric) — for high-quality or safety-critical code
lenient: boolUse the lenient preset (looser cutoff calibrated for the active metric) — for legacy or transitional code
no_fail: boolAlways exit 0, even when threshold violations exist.
Overrides only the exit-code translation; the underlying analysis
is untouched and result.passed in JSON output still reflects
the truthful pass/fail state, so consumers can detect “would
have failed” even when the process exits 0. Composes with
--quiet for silent success in CI. With --delta-gate, also
overrides the delta-gate exit-code translation (truth still in
delta.summary.passed).
delta_gate: boolFail the build (exit 1) when the baseline comparison introduces new threshold violations.
Off by default — delta is informational unless this flag is set.
Drives off delta.summary.passed, which is true iff
new_violations == 0. Pre-existing violations (functions that
already exceeded threshold in the baseline) do NOT contribute,
so re-running with no code changes never trips the gate. Only
meaningful with --baseline. Composes with --no-fail (which
overrides BOTH gates).
minimal_view: boolOmit the denormalized view.shown row array from JSON output.
Payload-size escape hatch for very large codebases. The
envelope’s result block (the gate) is unaffected; view.spec,
view.eligible_count, view.truncated, and view.shown_summary
remain so consumers retain full scope context. Only meaningful
with --format json.
summary: boolEmit a single-line analysis verdict instead of the full report.
Format: <STATUS>: <N> functions | <M> above threshold (<T>) | worst: <W> | avg: <A>
(e.g., PASS: 1082 functions | 0 above threshold (25) | worst: 13.0 | avg: 1.6).
Short-circuits --format: when set, the format dispatch is
skipped and only the summary line is printed to stdout.
Composes with --no-fail (exit 0 always when set, summary still
emitted) and --quiet (quiet wins — no output, exit code only).
Matches crap4ts’s --summary shape byte-for-byte for the shared
subset so a CI line-template can match either tool.
annotation_limit: Option<u32>Cap on the number of ::warning annotations the
github-annotations reporter emits per invocation.
GitHub Actions silently drops annotations past a per-step UI
cap (10 warning / 10 error / 10 notice per step, 50 per job).
When the eligible (exceeds == true) set exceeds this cap, the
reporter takes the top-N by CRAP and appends a single trailing
::notice::N more functions exceed threshold; see scorecard for the full list line so reviewers know findings were dropped.
Range 1..=100 (clap-enforced — 0 is rejected at the CLI
boundary because a zero cap is meaningless and almost always
indicates the user meant to omit the flag). Default 10 —
matches the GH Actions per-step display cap; raising the limit
past 10 produces annotations that the runner will drop. Only
meaningful with --format github-annotations; ignored by every
other reporter. Configurable per project via
[output] annotation_limit in the adapter’s TOML.
Trait Implementations§
Source§impl Args for OutputArgs
impl Args for OutputArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Debug for OutputArgs
impl Debug for OutputArgs
Source§impl FromArgMatches for OutputArgs
impl FromArgMatches for OutputArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.