Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sections/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ For example:
hooks:
- id: check-requirements
name: check requirements files
language: system
language: unsupported
entry: python -m scripts.check_requirements --compare
files: ^requirements.*\.txt$
```
Expand All @@ -291,7 +291,7 @@ You can configure repository-local hooks by specifying the [`repo`](#repos-repo)
sentinel `local`.

local hooks can use any language which supports [`additional_dependencies`](#config-additional_dependencies)
or [`docker_image`](#docker_image) / [`fail`](#fail) / [`pygrep`](#pygrep) / [`script`](#script) / [`system`](#system).
or [`docker_image`](#docker_image) / [`fail`](#fail) / [`pygrep`](#pygrep) / [`unsupported`](#unsupported) / [`unsupported_script`](#unsupported_script).
This enables you to install things which previously would require a trivial
mirror repository.

Expand All @@ -307,13 +307,13 @@ Here's an example configuration with a few `local` hooks:
- id: pylint
name: pylint
entry: pylint
language: system
language: unsupported
types: [python]
require_serial: true
- id: check-x
name: Check X
entry: ./bin/check-x.sh
language: script
language: unsupported_script
files: \.x$
- id: scss-lint
name: scss-lint
Expand Down
2 changes: 1 addition & 1 deletion sections/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ you may send [a pull request] to expand this list however there are a few
requirements you *must* follow or your PR will be closed without comment:

- the tool must already be fairly popular (>500 stars)
- the tool must use a managed language (no `system` / `script` / `docker` hooks)
- the tool must use a managed language (no `unsupported` / `unsupported_script` / `docker` hooks)
- the tool must operate on files

[a pull request]: https://github.com/pre-commit/pre-commit.com/blob/main/sections/hooks.md
28 changes: 16 additions & 12 deletions sections/new-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ Hello from foo hook!
- [rust](#rust)
- [swift](#swift)
- [pygrep](#pygrep)
- [script](#script)
- [system](#system)
- [unsupported](#unsupported)
- [unsupported_script](#unsupported_scripts)

### conda

Expand Down Expand Up @@ -492,23 +492,27 @@ To require all files to match, use `args: [--negate]`.
__Support:__ pygrep hooks are supported on all platforms which pre-commit runs
on.

### script
### unsupported

Script hooks provide a way to write simple scripts which validate files. The
[`entry`](#hooks-entry) should be a path relative to the root of the hook repository.
[anchor](__#system)
_new in 4.4.0_: previously `language: system`. the alias will be removed in a
future version

System hooks provide a way to write hooks for system-level executables which
don't have a supported language above (or have special environment
requirements that don't allow them to run in isolation such as pylint).

This hook type will not be given a virtual environment to work with – if it
needs additional dependencies the consumer must install them manually.

__Support:__ the support of script hooks depend on the scripts themselves.
### unsupported_script

### system
[anchor](__#script)
_new in 4.4.0_: previously `language: script`. the alias will be removed in a
future version

System hooks provide a way to write hooks for system-level executables which
don't have a supported language above (or have special environment
requirements that don't allow them to run in isolation such as pylint).
Script hooks provide a way to write simple scripts which validate files. The
[`entry`](#hooks-entry) should be a path relative to the root of the hook repository.

This hook type will not be given a virtual environment to work with – if it
needs additional dependencies the consumer must install them manually.

__Support:__ the support of system hooks depend on the executables.