Skip to main content

HookDefinition

Struct HookDefinition 

Source
pub struct HookDefinition {
Show 19 fields pub id: String, pub name: String, pub entry: String, pub language: String, pub files: Option<String>, pub exclude: Option<String>, pub types: Option<Vec<String>>, pub types_or: Option<Vec<String>>, pub exclude_types: Option<Vec<String>>, pub always_run: bool, pub fail_fast: bool, pub verbose: bool, pub pass_filenames: bool, pub require_serial: bool, pub description: String, pub language_version: String, pub minimum_pre_commit_version: String, pub args: Vec<String>, pub stages: Option<Vec<String>>,
}
Expand description

A single hook definition within a .pre-commit-hooks.yml file.

Fields§

§id: String

The ID of the hook, as used in .pre-commit-config.yml.

§name: String

The name of the hook, shown during execution.

§entry: String

The entrypoint for the hook, i.e. the executable to run.

This can also contain arguments that aren’t overridable, e.g. entry: autopep8 -i.

§language: String

The hook’s language.

§files: Option<String>

The pattern of files to run the hook on.

§exclude: Option<String>

Excludes files matches by files from the hook.

§types: Option<Vec<String>>

Default list of file times to run the hook on (AND).

§types_or: Option<Vec<String>>

Default list of file times to run the hook on (OR).

§exclude_types: Option<Vec<String>>

Default list of file times to exclude.

§always_run: bool

If true, run the hook even when there are no matching files.

§fail_fast: bool

If true, pre-commit will stop running hooks if this hook fails.

§verbose: bool

If true, force the hook’s output to be printed even if it passes.

§pass_filenames: bool

If false, no filenames will be passed to the hook.

§require_serial: bool

If true, this hook will execute using a single process instead of in parallel.

§description: String

A description of the hook, or '' if not given.

§language_version: String

The default version to use for Self::language.

§minimum_pre_commit_version: String

The minimum version of pre-commit required.

§args: Vec<String>

The default list of additional parameters to pass to the hook.

§stages: Option<Vec<String>>

The default set of stages to run the hook for.

Trait Implementations§

Source§

impl Debug for HookDefinition

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for HookDefinition

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.