[][src]Struct git_checks::builders::FormattingBuilder

pub struct FormattingBuilder { /* fields omitted */ }

Builder for Formatting.

Implementations

impl FormattingBuilder[src]

pub fn name<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

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

pub fn kind<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

The "kind" of formatting being performed.

This is used in the name of the attribute which uses this check.

Configuration: Required

pub fn formatter<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self[src]

The path to the formatter.

This may be a command that exists in PATH if absolute paths are not wanted.

Configuration: Required

pub fn fix_message<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

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.

pub fn timeout<VALUE: Into<Duration>>(&mut self, value: VALUE) -> &mut Self[src]

A timeout for running the formatter.

If the formatter exceeds this timeout, it is considered to have failed.

Configuration: Optional Default: No timeout

pub fn build(&self) -> Result<Formatting, String>[src]

Builds a new Formatting.

Errors

If a required field has not been initialized.

impl FormattingBuilder[src]

pub fn config_files<I, F>(&mut self, files: I) -> &mut Self where
    I: IntoIterator<Item = F>,
    F: Into<String>, 
[src]

Configuration files within the repository the formatter

Configuration: Optional Default: Vec::new()

Trait Implementations

impl Clone for FormattingBuilder[src]

impl Default for FormattingBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.