Skip to main content

ephemeris_report/
outcome.rs

1use std::fmt;
2
3use facet::Facet;
4
5/// How a check or a test ended.
6#[derive(Clone, Copy, Debug, Eq, Facet, PartialEq)]
7#[repr(u8)]
8pub enum Outcome {
9    /// The check succeeded.
10    #[facet(rename = "pass")]
11    Pass,
12    /// The check failed.
13    #[facet(rename = "fail")]
14    Fail,
15    /// The check did not run.
16    #[facet(rename = "skip")]
17    Skip,
18}
19
20impl fmt::Display for Outcome {
21    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22        f.write_str(match self {
23            Self::Pass => "pass",
24            Self::Fail => "fail",
25            Self::Skip => "skip",
26        })
27    }
28}
29
30/// Why a check did not run.
31#[derive(Clone, Copy, Debug, Eq, Facet, PartialEq)]
32#[repr(u8)]
33pub enum SkipReason {
34    /// The applicability command said the check does not apply.
35    #[facet(rename = "not-applicable")]
36    NotApplicable,
37    /// The check compares against a baseline and the repository has no origin.
38    #[facet(rename = "no-origin")]
39    NoOrigin,
40}