pub struct CommitVerdict {
pub message: CommitMessage,
pub passed: bool,
pub exempt: Option<CommitExemption>,
pub findings: Vec<Diagnostic>,
}Expand description
What the judge concluded: the message as it was parsed, whether anything of error
severity was found, the exemption when git composed the subject rather than a person, and
every finding in CommitRule::ALL order — which is the order the evidence for them
appears in the message, so a person reads them in the order they would fix them.
use majordomus_cli::commit::{judge, CommitPolicy, CommitSubject, CommitVerdict};
let v: CommitVerdict = judge(&CommitSubject::of("update stuff"), &CommitPolicy::default());
assert!(!v.passed);
assert_eq!(v.findings[0].code, "commit.not_conventional");
assert_eq!(v.message.header.subject, "update stuff", "what was judged, not what was typed");Fields§
§message: CommitMessageThe message as parsed; what was judged, not what was typed.
passed: boolWhether nothing of error severity was found.
exempt: Option<CommitExemption>Why the commit was not judged, when it was not.
findings: Vec<Diagnostic>Every finding, in CommitRule::ALL order.
Trait Implementations§
Source§impl Clone for CommitVerdict
impl Clone for CommitVerdict
Source§fn clone(&self) -> CommitVerdict
fn clone(&self) -> CommitVerdict
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommitVerdict
impl Debug for CommitVerdict
Source§impl<'de> Deserialize<'de> for CommitVerdict
impl<'de> Deserialize<'de> for CommitVerdict
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for CommitVerdict
impl JsonSchema for CommitVerdict
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for CommitVerdict
impl RefUnwindSafe for CommitVerdict
impl Send for CommitVerdict
impl Sync for CommitVerdict
impl Unpin for CommitVerdict
impl UnsafeUnpin for CommitVerdict
impl UnwindSafe for CommitVerdict
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more