Struct git_checks::Formatting
source · [−]pub struct Formatting { /* private fields */ }
Expand description
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
.
Implementations
sourceimpl Formatting
impl Formatting
sourcepub fn builder() -> FormattingBuilder
pub fn builder() -> FormattingBuilder
Create a new builder.
Trait Implementations
sourceimpl Clone for Formatting
impl Clone for Formatting
sourcefn clone(&self) -> Formatting
fn clone(&self) -> Formatting
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl ContentCheck for Formatting
impl ContentCheck for Formatting
Auto Trait Implementations
impl RefUnwindSafe for Formatting
impl Send for Formatting
impl Sync for Formatting
impl Unpin for Formatting
impl UnwindSafe for Formatting
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Check for T where
T: ContentCheck,
impl<T> Check for T where
T: ContentCheck,
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more