From ed4f60b5f538399b765988882eb0cdb61e5df851 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Sat, 8 Nov 2025 17:11:18 -0500 Subject: [PATCH] documentation updates for 4.4.0 --- sections/advanced.md | 8 ++++---- sections/hooks.md | 2 +- sections/new-hooks.md | 28 ++++++++++++++++------------ 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/sections/advanced.md b/sections/advanced.md index 6d1f1f65..b5f7f227 100644 --- a/sections/advanced.md +++ b/sections/advanced.md @@ -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$ ``` @@ -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. @@ -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 diff --git a/sections/hooks.md b/sections/hooks.md index 1a97d5dc..27dc128c 100644 --- a/sections/hooks.md +++ b/sections/hooks.md @@ -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 diff --git a/sections/new-hooks.md b/sections/new-hooks.md index 70699666..7f35b991 100644 --- a/sections/new-hooks.md +++ b/sections/new-hooks.md @@ -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 @@ -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.