[−][src]Struct git_checks::checks::CommitSubject
Check commit message subjects for invalid patterns.
Methods
impl CommitSubject[src]
pub fn new() -> Self[src]
Checks commit message subjects for invalid patterns
Patterns which are checked for:
- overly long or short summary lines;
- work-in-progress messages;
fixup!andsquash!messages; and- custom prefixes.
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).
pub fn with_summary_limits(&mut self, min: usize, max: usize) -> &mut Self[src]
Check the summary line with the given limits.
pub fn check_work_in_progress(&mut self, wip: bool) -> &mut Self[src]
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.
pub fn check_rebase_commands(&mut self, rebase: bool) -> &mut Self[src]
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.
pub fn with_tolerated_prefixes<I, P>(&mut self, patterns: I) -> &mut Self where
I: IntoIterator<Item = P>,
P: Into<Regex>, [src]
I: IntoIterator<Item = P>,
P: Into<Regex>,
Check for tolerated commit subject prefixes.
The specified prefix patterns will be tolerated regardless of any configured allowed or disallowed prefixes.
pub fn with_allowed_prefixes<I, P>(&mut self, prefixes: I) -> &mut Self where
I: IntoIterator<Item = P>,
P: Into<String>, [src]
I: IntoIterator<Item = P>,
P: Into<String>,
Check for required commit prefixes.
The specified prefixes will be the only allowed prefixes on commit message subjects that do not match a tolerated pattern.
pub fn with_disallowed_prefixes<I, P>(&mut self, prefixes: I) -> &mut Self where
I: IntoIterator<Item = P>,
P: Into<String>, [src]
I: IntoIterator<Item = P>,
P: Into<String>,
Check for disallowed commit prefixes.
The specified prefixes will be rejected on commit message subjects that do not also match a tolerated pattern.
Trait Implementations
impl Check for CommitSubject[src]
fn name(&self) -> &str[src]
fn check(&self, _: &CheckGitContext, commit: &Commit) -> Result<CheckResult>[src]
impl Default for CommitSubject[src]
fn default() -> CommitSubject[src]
impl Clone for CommitSubject[src]
fn clone(&self) -> CommitSubject[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for CommitSubject[src]
Auto Trait Implementations
impl Send for CommitSubject
impl Unpin for CommitSubject
impl Sync for CommitSubject
impl UnwindSafe for CommitSubject
impl !RefUnwindSafe for CommitSubject
Blanket Implementations
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,