Skip to main content

OutputArgs

Struct OutputArgs 

Source
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: bool

Use the strict preset (tighter cutoff calibrated for the active metric) — for high-quality or safety-critical code

§lenient: bool

Use the lenient preset (looser cutoff calibrated for the active metric) — for legacy or transitional code

§no_fail: bool

Always 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: bool

Fail 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: bool

Omit 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: bool

Emit 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

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Debug for OutputArgs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for OutputArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.