[−][src]Struct git_checks::Formatting
Run a formatter in the repository to check commits for formatting.
The formatter is passed a single argument: the path to the file which should be checked.
The formatter is expected to exit with success whether the path passed to it has a valid format in it or not. A failure exit status is considered a failure of the formatter itself. If any changes (including untracked files) are left inside of the worktree, it is considered to have failed the checks.
The formatter is run with its current working directory being the top-level of the work tree,
but not the proper GIT_
context. This is because the setup for the workarea is not completely
isolated and git
commands may not behave as expected. The worktree it is working from is only
guaranteed to have the files which have changed in the commit being checked on disk, so
additional files which should be available for the command to run must be specified with
Formatting::add_config_files
.
Methods
impl Formatting
[src]
pub fn builder() -> FormattingBuilder
[src]
Create a new builder.
Trait Implementations
impl Clone for Formatting
[src]
fn clone(&self) -> Formatting
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Formatting
[src]
impl ContentCheck for Formatting
[src]
Auto Trait Implementations
impl Send for Formatting
impl Sync for Formatting
impl Unpin for Formatting
impl UnwindSafe for Formatting
impl RefUnwindSafe for Formatting
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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, 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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Check for T where
T: ContentCheck,
[src]
T: ContentCheck,
fn name(&self) -> &str
[src]
fn check(
&self,
ctx: &CheckGitContext,
commit: &Commit
) -> Result<CheckResult, Box<dyn Error + 'static>>
[src]
&self,
ctx: &CheckGitContext,
commit: &Commit
) -> Result<CheckResult, Box<dyn Error + 'static>>
impl<T> TopicCheck for T where
T: ContentCheck,
[src]
T: ContentCheck,