pub struct Definition {
pub types: Option<Vec<String>>,
pub thresholds: Option<Thresholds>,
}Expand description
Configuration for a commit-message check.
Both fields are optional. When omitted, defaults apply:
standard Conventional Commits types and { fail: 0 }.
use scute_core::commit_message::Definition;
use scute_core::Thresholds;
use scute_core::commit_message;
let def = Definition {
types: Some(vec!["hotfix".into()]),
thresholds: Some(Thresholds { warn: None, fail: Some(0) }),
};
let evals = commit_message::check("hotfix: urgent patch", &def).unwrap();
assert!(evals[0].is_pass());
let evals = commit_message::check("feat: add login", &def).unwrap();
assert!(evals[0].is_fail());Fields§
§types: Option<Vec<String>>§thresholds: Option<Thresholds>Trait Implementations§
Source§impl Debug for Definition
impl Debug for Definition
Source§impl Default for Definition
impl Default for Definition
Source§fn default() -> Definition
fn default() -> Definition
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Definition
impl<'de> Deserialize<'de> for Definition
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
Auto Trait Implementations§
impl Freeze for Definition
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin for Definition
impl UnsafeUnpin for Definition
impl UnwindSafe for Definition
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