Skip to main content

PreCommitHook

Struct PreCommitHook 

Source
pub struct PreCommitHook {
Show 21 fields pub id: String, pub additional_dependencies: Option<BTreeSet<String>>, pub alias: Option<String>, pub always_run: Option<bool>, pub args: Option<Vec<String>>, pub entry: Option<String>, pub exclude: Option<String>, pub exclude_types: Option<BTreeSet<FileType>>, pub description: Option<String>, pub files: Option<String>, pub language: Option<Language>, pub language_version: Option<String>, pub log_file: Option<String>, pub minimum_pre_commit_version: Option<usize>, pub name: Option<String>, pub pass_filenames: Option<bool>, pub require_serial: Option<bool>, pub stages: Option<BTreeSet<Stage>>, pub types: Option<BTreeSet<FileType>>, pub types_or: Option<BTreeSet<FileType>>, pub verbose: Option<bool>,
}
Expand description

Description for a pre-commit hook. https://pre-commit.com/#pre-commit-configyaml—hooks

Fields§

§id: String

An identifier of the current hook https://pre-commit.com/#pre-commit-configyaml—hooks

§additional_dependencies: Option<BTreeSet<String>>

A list of additional_dependencies of the current hook https://pre-commit.com/#pre-commit-configyaml—hooks

§alias: Option<String>

An additional identifier of the current hook for pre-commit run <hookid> https://pre-commit.com/#pre-commit-configyaml—hooks

§always_run: Option<bool>

Run the current hook when no files matched https://pre-commit.com/#pre-commit-configyaml—hooks

§args: Option<Vec<String>>

List of additional parameters to pass to the current hook https://pre-commit.com/#pre-commit-configyaml—hooks

§entry: Option<String>

A command of the current hook https://pre-commit.com/#pre-commit-configyaml—hooks

§exclude: Option<String>

Exclude files that were matched by files.

§exclude_types: Option<BTreeSet<FileType>>

A list of file types to exclude of the current hook https://pre-commit.com/#pre-commit-configyaml—hooks

§description: Option<String>

Description of the hook. used for metadata purposes only.

§files: Option<String>

The pattern of files to run on.

§language: Option<Language>

A language the current hook is written in https://pre-commit.com/#pre-commit-configyaml—hooks

§language_version: Option<String>

Mappings for the default language versions of the current project https://pre-commit.com/#pre-commit-configyaml—top-level

§log_file: Option<String>

A log file of the current hook

§minimum_pre_commit_version: Option<usize>

Allows one to indicate a minimum compatible pre-commit version.

§name: Option<String>

Name of the hook - shown during hook execution.

§pass_filenames: Option<bool>

Whether to pass filenames to the current hook or not https://pre-commit.com/#pre-commit-configyaml—hooks

§require_serial: Option<bool>

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

§stages: Option<BTreeSet<Stage>>

A stage of the current hook https://pre-commit.com/#pre-commit-configyaml—hooks

§types: Option<BTreeSet<FileType>>

List of file types to run on (AND).

§types_or: Option<BTreeSet<FileType>>

List of file types to run on (OR).

§verbose: Option<bool>

Display an output of the current hook even it passes https://pre-commit.com/#pre-commit-configyaml—hooks

Trait Implementations§

Source§

impl Clone for PreCommitHook

Source§

fn clone(&self) -> PreCommitHook

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PreCommitHook

Source§

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

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

impl Default for PreCommitHook

Source§

fn default() -> PreCommitHook

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PreCommitHook

Source§

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

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Ord for PreCommitHook

Source§

fn cmp(&self, other: &PreCommitHook) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for PreCommitHook

Source§

fn eq(&self, other: &PreCommitHook) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for PreCommitHook

Source§

fn partial_cmp(&self, other: &PreCommitHook) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for PreCommitHook

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for PreCommitHook

Source§

impl StructuralPartialEq for PreCommitHook

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

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