Struct git_checks::checks::CommitSubject
[−]
[src]
pub struct CommitSubject { /* fields omitted */ }
Check commit message subjects for invalid patterns.
Methods
impl CommitSubject
[src]
fn new() -> Self
Checks commit message subjects for invalid patterns
Patterns which are checked for:
- overly long or short summary lines;
- work-in-progress messages; and
- fixup!
and squash!
messages.
Commit messages which appear to have been auto generated by actions such as merging or reverting commits will skip the summary line length limit (if enforced).
fn with_summary_limits(&mut self, min: usize, max: usize) -> &mut Self
Check the summary line with the given limits.
fn check_work_in_progress(&mut self, wip: bool) -> &mut Self
Checks for work-in-progress commits
Commit messages which mention WIP
or wip
at the beginning of their commit messages are
rejected since they are (nominally) incomplete.
fn check_rebase_commands(&mut self, rebase: bool) -> &mut Self
Check for rebase commands
Rebase commands include commits which begin with fixup!
or squash!
. These subjects
are used to indicate that the commit belongs somewhere else in the branch and should be
completed before merging.
Trait Implementations
impl Debug for CommitSubject
[src]
impl Default for CommitSubject
[src]
fn default() -> CommitSubject
Returns the "default value" for a type. Read more
impl Clone for CommitSubject
[src]
fn clone(&self) -> CommitSubject
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for CommitSubject
[src]
impl Check for CommitSubject
[src]
fn name(&self) -> &str
The name of the check.
fn check(&self, _: &CheckGitContext, commit: &Commit) -> Result<CheckResult>
Run the check.