Struct git_checks::builders::CommitSubjectBuilder
source · [−]pub struct CommitSubjectBuilder { /* private fields */ }
Expand description
Builder for CommitSubject
.
Implementations
sourceimpl CommitSubjectBuilder
impl CommitSubjectBuilder
sourcepub fn min_summary(&mut self, value: usize) -> &mut Self
pub fn min_summary(&mut self, value: usize) -> &mut Self
The minimum length allowed for the summary line.
Configuration: Optional
Default: 8
sourcepub fn max_summary(&mut self, value: usize) -> &mut Self
pub fn max_summary(&mut self, value: usize) -> &mut Self
The maximum length allowed for the summary line.
Configuration: Optional
Default: 78
sourcepub fn check_work_in_progress(&mut self, value: bool) -> &mut Self
pub fn check_work_in_progress(&mut self, value: bool) -> &mut Self
Whether to deny work-in-progress commits or not.
Commit messages which mention WIP
, wip
, or a few variants of Draft
at the beginning
of their commit messages are rejected since they are (nominally) incomplete.
Configuration: Optional
Default: true
sourcepub fn check_rebase_commands(&mut self, value: bool) -> &mut Self
pub fn check_rebase_commands(&mut self, value: bool) -> &mut Self
Check for rebase commands
Rebase commands include commits which begin with fixup!
, squash!
, or amend!
. These
subjects are used to indicate that the commit belongs somewhere else in the branch and
should be completed before merging.
Configuration: Optional
Default: true
sourcepub fn check_suggestion_subjects(&mut self, value: bool) -> &mut Self
pub fn check_suggestion_subjects(&mut self, value: bool) -> &mut Self
Check for suggestions applied through a hosting facility
Some hosting services support applying suggestions for changes to a topic as a new commit. Enabling this option detects these subjects and rejects the commit as the code suggestion should be squashed back into the relevant commit.
Configuration: Optional
Default: false
sourcepub fn build(&self) -> Result<CommitSubject, CommitSubjectBuilderError>
pub fn build(&self) -> Result<CommitSubject, CommitSubjectBuilderError>
sourceimpl CommitSubjectBuilder
impl CommitSubjectBuilder
sourcepub fn tolerated_prefixes<I, P>(&mut self, patterns: I) -> &mut Self where
I: IntoIterator<Item = P>,
P: Into<Regex>,
pub fn tolerated_prefixes<I, P>(&mut self, patterns: I) -> &mut Self where
I: IntoIterator<Item = P>,
P: Into<Regex>,
Tolerated prefixes for commits.
The specified prefix patterns will be tolerated regardless of any configured allowed or disallowed prefixes.
Configuration: Optional
Default: Vec::new()
sourcepub fn allowed_prefixes<I, P>(&mut self, prefixes: I) -> &mut Self where
I: IntoIterator<Item = P>,
P: Into<String>,
pub fn allowed_prefixes<I, P>(&mut self, prefixes: I) -> &mut Self where
I: IntoIterator<Item = P>,
P: Into<String>,
Required prefixes for commits.
The specified prefixes will be the only allowed prefixes on commit message subjects that do not match a tolerated pattern.
Configuration: Optional
Default: Vec::new()
sourcepub fn disallowed_prefixes<I, P>(&mut self, prefixes: I) -> &mut Self where
I: IntoIterator<Item = P>,
P: Into<String>,
pub fn disallowed_prefixes<I, P>(&mut self, prefixes: I) -> &mut Self where
I: IntoIterator<Item = P>,
P: Into<String>,
Forbidden prefixes for commits.
The specified prefixes will be rejected on commit message subjects that do not also match a tolerated pattern.
Configuration: Optional
Default: Vec::new()
Trait Implementations
sourceimpl Clone for CommitSubjectBuilder
impl Clone for CommitSubjectBuilder
sourcefn clone(&self) -> CommitSubjectBuilder
fn clone(&self) -> CommitSubjectBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for CommitSubjectBuilder
impl Send for CommitSubjectBuilder
impl Sync for CommitSubjectBuilder
impl Unpin for CommitSubjectBuilder
impl UnwindSafe for CommitSubjectBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more