Struct git_checks::builders::CommitSubjectBuilder
source · 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 Selfwhere
I: IntoIterator<Item = P>,
P: Into<Regex>,
pub fn tolerated_prefixes<I, P>(&mut self, patterns: I) -> &mut Selfwhere 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 Selfwhere
I: IntoIterator<Item = P>,
P: Into<String>,
pub fn allowed_prefixes<I, P>(&mut self, prefixes: I) -> &mut Selfwhere 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 Selfwhere
I: IntoIterator<Item = P>,
P: Into<String>,
pub fn disallowed_prefixes<I, P>(&mut self, prefixes: I) -> &mut Selfwhere 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§
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 more