Type object
File match prek.toml
Schema URL https://catalog.lintel.tools/schemas/schemastore/prek/latest.json
Source https://www.schemastore.org/prek.json

Validate with Lintel

npx @lintel/lintel check
Type: object

The configuration file for prek, a git hook manager written in Rust.

Properties

repos Repo[] required
default_install_hook_types HookType[]

A list of --hook-types which will be used by default when running prek install. Default is [pre-commit].

default_language_version object

A mapping from language to the default language_version.

22 nested properties
bun string
conda string
coursier string
dart string
docker string
docker_image string
dotnet string
fail string
golang string
haskell string
julia string
lua string
node string
perl string
pygrep string
python string
r string
ruby string
rust string
script string
swift string
system string
default_stages Stage[]

A configuration-wide default for the stages property of hooks. Default to all stages.

files string | object

A file pattern, either a regex or glob pattern(s).

exclude string | object

A file pattern, either a regex or glob pattern(s).

fail_fast boolean

Set to true to have prek stop running hooks after the first failure. Default is false.

minimum_prek_version string

The minimum version of prek required to run this configuration.

orphan boolean

Set to true to isolate this project from parent configurations in workspace mode. When true, files in this project are "consumed" by this project and will not be processed by parent projects. When false (default), files in subprojects are processed by both the subproject and any parent projects that contain them.

Definitions

Repo object

A repository of hooks, which can be remote, local, meta, or builtin.

RemoteRepo object
repo string required

Remote repository location. Must not be local, meta, or builtin.

rev string required
hooks RemoteHook[] required
RemoteHook object

A remote hook in the configuration file.

All keys in manifest hook dict are valid in a config hook dict, but are optional.

id string required

The id of the hook.

name string

Override the name of the hook.

entry string

Override the entrypoint. Not documented in the official docs but works.

language string
Values: "bun" "conda" "coursier" "dart" "docker" "docker_image" "dotnet" "fail" "golang" "haskell" "julia" "lua" "node" "perl" "pygrep" "python" "r" "ruby" "rust" "script" "swift" "system"
priority integer

Priority used by the scheduler to determine ordering and concurrency. Hooks with the same priority can run in parallel.

This is only allowed in project config files (e.g. .pre-commit-config.yaml). It is not allowed in manifests (e.g. .pre-commit-hooks.yaml).

min=0
alias string

Not documented in the official docs.

files string | object

A file pattern, either a regex or glob pattern(s).

exclude string | object

A file pattern, either a regex or glob pattern(s).

types string[]

List of file types to run on (AND). Default is [file], which matches all files.

types_or string[]

List of file types to run on (OR). Default is [].

exclude_types string[]

List of file types to exclude. Default is [].

additional_dependencies string[]

Not documented in the official docs.

args string[]

Additional arguments to pass to the hook.

env Record<string, string>

Environment variables to set for the hook.

always_run boolean

This hook will run even if there are no matching files. Default is false.

fail_fast boolean

If this hook fails, don't run any more hooks. Default is false.

pass_filenames boolean

Append filenames that would be checked to the hook entry as arguments. Default is true.

description string

A description of the hook. For metadata only.

language_version string

Run the hook on a specific version of the language. Default is default. See https://pre-commit.com/#overriding-language-version.

log_file string

Write the output of the hook to a file when the hook fails or verbose is enabled.

require_serial boolean

This hook will execute using a single process instead of in parallel. Default is false.

stages Stage[]

Select which git hook(s) to run for. Default all stages are selected. See https://pre-commit.com/#confining-hooks-to-run-at-certain-stages.

verbose boolean

Print the output of the hook even if it passes. Default is false.

minimum_prek_version string

The minimum version of prek required to run this hook.

Language string
FilePattern string | object

A file pattern, either a regex or glob pattern(s).

Stage string
LocalRepo object
repo string required

Must be local.

Constant: "local"
hooks LocalHook[] required
LocalHook object

A local hook in the configuration file.

This is similar to ManifestHook, but includes config-only fields (like priority).

id string required

The id of the hook.

name string required

The name of the hook.

entry string required

The command to run. It can contain arguments that will not be overridden.

language string required
Values: "bun" "conda" "coursier" "dart" "docker" "docker_image" "dotnet" "fail" "golang" "haskell" "julia" "lua" "node" "perl" "pygrep" "python" "r" "ruby" "rust" "script" "swift" "system"
priority integer

Priority used by the scheduler to determine ordering and concurrency. Hooks with the same priority can run in parallel.

min=0
alias string

Not documented in the official docs.

files string | object

A file pattern, either a regex or glob pattern(s).

exclude string | object

A file pattern, either a regex or glob pattern(s).

types string[]

List of file types to run on (AND). Default is [file], which matches all files.

types_or string[]

List of file types to run on (OR). Default is [].

exclude_types string[]

List of file types to exclude. Default is [].

additional_dependencies string[]

Not documented in the official docs.

args string[]

Additional arguments to pass to the hook.

env Record<string, string>

Environment variables to set for the hook.

always_run boolean

This hook will run even if there are no matching files. Default is false.

fail_fast boolean

If this hook fails, don't run any more hooks. Default is false.

pass_filenames boolean

Append filenames that would be checked to the hook entry as arguments. Default is true.

description string

A description of the hook. For metadata only.

language_version string

Run the hook on a specific version of the language. Default is default. See https://pre-commit.com/#overriding-language-version.

log_file string

Write the output of the hook to a file when the hook fails or verbose is enabled.

require_serial boolean

This hook will execute using a single process instead of in parallel. Default is false.

stages Stage[]

Select which git hook(s) to run for. Default all stages are selected. See https://pre-commit.com/#confining-hooks-to-run-at-certain-stages.

verbose boolean

Print the output of the hook even if it passes. Default is false.

minimum_prek_version string

The minimum version of prek required to run this hook.

MetaRepo object
repo string required

Must be meta.

Constant: "meta"
hooks MetaHook[] required
MetaHook object

A meta hook predefined in prek.

id string required
Values: "check-hooks-apply" "check-useless-excludes" "identity"
name string

Override the name of the hook.

entry const: false

Entry is not allowed for predefined hooks.

Constant: false
language string

Language must be system for predefined hooks (or omitted).

Values: "system"
priority integer

Priority used by the scheduler to determine ordering and concurrency. Hooks with the same priority can run in parallel.

This is only allowed in project config files (e.g. .pre-commit-config.yaml). It is not allowed in manifests (e.g. .pre-commit-hooks.yaml).

min=0
alias string

Not documented in the official docs.

files string | object

A file pattern, either a regex or glob pattern(s).

exclude string | object

A file pattern, either a regex or glob pattern(s).

types string[]

List of file types to run on (AND). Default is [file], which matches all files.

types_or string[]

List of file types to run on (OR). Default is [].

exclude_types string[]

List of file types to exclude. Default is [].

additional_dependencies string[]

Not documented in the official docs.

args string[]

Additional arguments to pass to the hook.

env Record<string, string>

Environment variables to set for the hook.

always_run boolean

This hook will run even if there are no matching files. Default is false.

fail_fast boolean

If this hook fails, don't run any more hooks. Default is false.

pass_filenames boolean

Append filenames that would be checked to the hook entry as arguments. Default is true.

description string

A description of the hook. For metadata only.

language_version string

Run the hook on a specific version of the language. Default is default. See https://pre-commit.com/#overriding-language-version.

log_file string

Write the output of the hook to a file when the hook fails or verbose is enabled.

require_serial boolean

This hook will execute using a single process instead of in parallel. Default is false.

stages Stage[]

Select which git hook(s) to run for. Default all stages are selected. See https://pre-commit.com/#confining-hooks-to-run-at-certain-stages.

verbose boolean

Print the output of the hook even if it passes. Default is false.

minimum_prek_version string

The minimum version of prek required to run this hook.

MetaHooks string
BuiltinRepo object
repo string required

Must be builtin.

Constant: "builtin"
hooks BuiltinHook[] required
BuiltinHook object

A builtin hook predefined in prek.

id string required
Values: "check-added-large-files" "check-case-conflict" "check-executables-have-shebangs" "check-json" "check-json5" "check-merge-conflict" "check-symlinks" "check-toml" "check-xml" "check-yaml" "detect-private-key" "end-of-file-fixer" "fix-byte-order-marker" "mixed-line-ending" "no-commit-to-branch" "trailing-whitespace"
name string

Override the name of the hook.

entry const: false

Entry is not allowed for predefined hooks.

Constant: false
language string

Language must be system for predefined hooks (or omitted).

Values: "system"
priority integer

Priority used by the scheduler to determine ordering and concurrency. Hooks with the same priority can run in parallel.

This is only allowed in project config files (e.g. .pre-commit-config.yaml). It is not allowed in manifests (e.g. .pre-commit-hooks.yaml).

min=0
alias string

Not documented in the official docs.

files string | object

A file pattern, either a regex or glob pattern(s).

exclude string | object

A file pattern, either a regex or glob pattern(s).

types string[]

List of file types to run on (AND). Default is [file], which matches all files.

types_or string[]

List of file types to run on (OR). Default is [].

exclude_types string[]

List of file types to exclude. Default is [].

additional_dependencies string[]

Not documented in the official docs.

args string[]

Additional arguments to pass to the hook.

env Record<string, string>

Environment variables to set for the hook.

always_run boolean

This hook will run even if there are no matching files. Default is false.

fail_fast boolean

If this hook fails, don't run any more hooks. Default is false.

pass_filenames boolean

Append filenames that would be checked to the hook entry as arguments. Default is true.

description string

A description of the hook. For metadata only.

language_version string

Run the hook on a specific version of the language. Default is default. See https://pre-commit.com/#overriding-language-version.

log_file string

Write the output of the hook to a file when the hook fails or verbose is enabled.

require_serial boolean

This hook will execute using a single process instead of in parallel. Default is false.

stages Stage[]

Select which git hook(s) to run for. Default all stages are selected. See https://pre-commit.com/#confining-hooks-to-run-at-certain-stages.

verbose boolean

Print the output of the hook even if it passes. Default is false.

minimum_prek_version string

The minimum version of prek required to run this hook.

BuiltinHooks string
HookType string