Struct git_checks::builders::FormattingBuilder
source · pub struct FormattingBuilder { /* private fields */ }
Expand description
Builder for Formatting
.
Implementations§
source§impl 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>
source§impl FormattingBuilder
impl FormattingBuilder
sourcepub fn config_files<I, F>(&mut self, files: I) -> &mut Selfwhere
I: IntoIterator<Item = F>,
F: Into<String>,
pub fn config_files<I, F>(&mut self, files: I) -> &mut Selfwhere I: IntoIterator<Item = F>, F: Into<String>,
Configuration files within the repository the formatter
Configuration: Optional
Default: Vec::new()
Trait Implementations§
source§impl Clone for FormattingBuilder
impl Clone for FormattingBuilder
source§fn clone(&self) -> FormattingBuilder
fn clone(&self) -> FormattingBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more