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: StringThe ID of the hook, as used in .pre-commit-config.yml.
name: StringThe name of the hook, shown during execution.
entry: StringThe 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: StringThe 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: boolIf true, run the hook even when there are no matching files.
fail_fast: boolIf true, pre-commit will stop running hooks if this hook fails.
verbose: boolIf true, force the hook’s output to be printed even if it passes.
pass_filenames: boolIf false, no filenames will be passed to the hook.
require_serial: boolIf true, this hook will execute using a single process instead of in parallel.
description: StringA description of the hook, or '' if not given.
language_version: StringThe default version to use for Self::language.
minimum_pre_commit_version: StringThe 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.