pub struct CommitSubjectBuilder { /* private fields */ }
Expand description
Builder for CommitSubject
.
Implementations§
Source§impl 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>
Source§impl CommitSubjectBuilder
impl CommitSubjectBuilder
Sourcepub fn tolerated_prefixes<I, P>(&mut self, patterns: I) -> &mut Self
pub fn tolerated_prefixes<I, P>(&mut self, patterns: I) -> &mut Self
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
pub fn allowed_prefixes<I, P>(&mut self, prefixes: I) -> &mut Self
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
pub fn disallowed_prefixes<I, P>(&mut self, prefixes: I) -> &mut Self
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§
Source§impl Clone for CommitSubjectBuilder
impl Clone for CommitSubjectBuilder
Source§fn clone(&self) -> CommitSubjectBuilder
fn clone(&self) -> CommitSubjectBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for CommitSubjectBuilder
impl RefUnwindSafe for CommitSubjectBuilder
impl Send for CommitSubjectBuilder
impl Sync for CommitSubjectBuilder
impl Unpin for CommitSubjectBuilder
impl UnwindSafe for CommitSubjectBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more