Struct git_checks::builders::FormattingBuilder
source · [−]pub struct FormattingBuilder { /* private fields */ }Expand description
Builder for Formatting.
Implementations
sourceimpl FormattingBuilder
impl FormattingBuilder
sourcepub fn name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The “name” of the formatter.
This is used to refer to the formatter in use in error messages.
Configuration: Optional
Default: the kind is used
sourcepub fn kind<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn kind<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The “kind” of formatting being performed.
This is used in the name of the attribute which uses this check.
Configuration: Required
sourcepub fn formatter<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
pub fn formatter<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self
The path to the formatter.
This may be a command that exists in PATH if absolute paths are not wanted.
Configuration: Required
sourcepub fn fix_message<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn fix_message<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
A message to add when failures occur.
Projects which check formatting may have a way to fix it automatically. This is here so that those projects can mention their specific instructions.
Configuration: Optional Default: Unused if not provided.
sourcepub fn timeout<VALUE: Into<Duration>>(&mut self, value: VALUE) -> &mut Self
pub fn timeout<VALUE: Into<Duration>>(&mut self, value: VALUE) -> &mut Self
A timeout for running the formatter.
If the formatter exceeds this timeout, it is considered to have failed.
Configuration: Optional Default: No timeout
sourcepub fn build(&self) -> Result<Formatting, FormattingBuilderError>
pub fn build(&self) -> Result<Formatting, FormattingBuilderError>
sourceimpl FormattingBuilder
impl FormattingBuilder
sourcepub fn config_files<I, F>(&mut self, files: I) -> &mut Self where
I: IntoIterator<Item = F>,
F: Into<String>,
pub fn config_files<I, F>(&mut self, files: I) -> &mut Self where
I: IntoIterator<Item = F>,
F: Into<String>,
Configuration files within the repository the formatter
Configuration: Optional
Default: Vec::new()
Trait Implementations
sourceimpl Clone for FormattingBuilder
impl Clone for FormattingBuilder
sourcefn clone(&self) -> FormattingBuilder
fn clone(&self) -> FormattingBuilder
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
Auto Trait Implementations
impl RefUnwindSafe for FormattingBuilder
impl Send for FormattingBuilder
impl Sync for FormattingBuilder
impl Unpin for FormattingBuilder
impl UnwindSafe for FormattingBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more