From 5190e5304afc3baddf1a4b42e1268b663a9d1a6c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 5 Sep 2020 14:38:03 -0700 Subject: [PATCH 001/490] fix origin.HEAD, that's not a thing --- index.mako | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.mako b/index.mako index 45100ab8..1fced3b5 100644 --- a/index.mako +++ b/index.mako @@ -1560,7 +1560,7 @@ pre-commit can also be used as a tool for continuous integration. For instance, adding `pre-commit run --all-files` as a CI step will ensure everything stays in tip-top shape. To check only files which have changed, which may be faster, use something like -`pre-commit run --from-ref origin.HEAD --to-ref HEAD` +`pre-commit run --from-ref origin/HEAD --to-ref HEAD` ## Managing CI Caches From 66f5b49a76be8a63f94d1406e7d6ec0c64b28e0d Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen Date: Tue, 15 Sep 2020 22:52:05 +0300 Subject: [PATCH 002/490] Update mdformat repository owner --- all-repos.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all-repos.yaml b/all-repos.yaml index 43718d23..651185b7 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -138,7 +138,7 @@ # - https://github.com/hakancelik96/unimport - https://github.com/PeterMosmans/jenkinslint - https://github.com/nicklockwood/SwiftFormat -- https://github.com/hukkinj1/mdformat +- https://github.com/executablebooks/mdformat - https://gitlab.com/daverona/pre-commit/php - https://github.com/anderseknert/pre-commit-opa - https://github.com/radix-ai/auto-smart-commit From e0bea46827c3ec39c87691a5becfd4084560292b Mon Sep 17 00:00:00 2001 From: vinay karanam Date: Sat, 19 Sep 2020 17:39:38 +0530 Subject: [PATCH 003/490] Added curlylint to all-repos.yaml --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index 651185b7..848dfcda 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -142,3 +142,4 @@ - https://gitlab.com/daverona/pre-commit/php - https://github.com/anderseknert/pre-commit-opa - https://github.com/radix-ai/auto-smart-commit +- https://github.com/thibaudcolas/curlylint From 3757529a0b697c3b24cbbc7381da777c35893cdd Mon Sep 17 00:00:00 2001 From: Raphael Boidol Date: Tue, 22 Sep 2020 22:50:55 +0200 Subject: [PATCH 004/490] Document `stages` for new hooks --- index.mako | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.mako b/index.mako index 1fced3b5..849b09dd 100644 --- a/index.mako +++ b/index.mako @@ -465,6 +465,12 @@ file that tells pre-commit: =r= =c= [`args`](_#hooks-args) =c= (optional: default `[]`) list of additional parameters to pass to the hook. +=r= + =c= [`stages`](_#hooks-stages) + =c= (optional: default (all stages)) confines the hook to the `commit`, `merge-commit`, + `push`, `prepare-commit-msg`, `commit-msg`, `post-checkout`, `post-commit`, or + `manual` stage. See + [Confining hooks to run at certain stages](#confining-hooks-to-run-at-certain-stages). ``` From b560190cd99dec8decbbbbef9c44e1e8e58b1a25 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Wed, 23 Sep 2020 09:16:39 -0700 Subject: [PATCH 005/490] Adds cmake-format-precommit to list of all_repos Adds the offiical cmake-format-precommit hook to the list of repos. --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index 848dfcda..691a78b5 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -143,3 +143,4 @@ - https://github.com/anderseknert/pre-commit-opa - https://github.com/radix-ai/auto-smart-commit - https://github.com/thibaudcolas/curlylint +- https://github.com/cheshirekow/cmake-format-precommit From 94028ea5fbc14eaf5c210544ae3ea17a6ffd3cb1 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Wed, 23 Sep 2020 13:03:16 -0400 Subject: [PATCH 006/490] Remove outdated pre-commit hook Remove outdated pre-commit hook --- all-repos.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/all-repos.yaml b/all-repos.yaml index 691a78b5..8d14f6f8 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -104,7 +104,6 @@ - https://github.com/codingjoe/relint - https://github.com/nix-community/nixpkgs-fmt - https://github.com/d6e/beancount-check -- https://github.com/iconmaster5326/cmake-format-pre-commit-hook # - https://github.com/thg-consulting/inspectortiger - https://gitlab.com/iamlikeme/nbhooks - https://github.com/Kuniwak/vint From 8ed00c9e311913f2dde070baab5ba814f3be1f5e Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 23 Sep 2020 19:16:32 -0700 Subject: [PATCH 007/490] chriskuehl/identify was moved into pre-commit! --- index.mako | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.mako b/index.mako index 849b09dd..4a279d6e 100644 --- a/index.mako +++ b/index.mako @@ -1400,7 +1400,7 @@ with `files`. `types` is specified per hook as an array of tags. The tags are discovered through a set of heuristics by the -[identify](https://github.com/chriskuehl/identify) library. `identify` was +[identify](https://github.com/pre-commit/identify) library. `identify` was chosen as it is a small portable pure python library. Some of the common tags you'll find from identify: @@ -1411,8 +1411,8 @@ Some of the common tags you'll find from identify: - `executable` - whether the file has the executable bit set - `text` - whether the file looks like a text file - `binary` - whether the file looks like a binary file -- [tags by extension / naming convention](https://github.com/chriskuehl/identify/blob/master/identify/extensions.py) -- [tags by shebang (`#!`)](https://github.com/chriskuehl/identify/blob/master/identify/interpreters.py) +- [tags by extension / naming convention](https://github.com/pre-commit/identify/blob/master/identify/extensions.py) +- [tags by shebang (`#!`)](https://github.com/pre-commit/identify/blob/master/identify/interpreters.py) To discover the type of any file on disk, you can use `identify`'s cli: @@ -1426,7 +1426,7 @@ $ identify-cli --filename-only some-random-file; echo $? ``` If a file extension you use is not supported, please -[submit a pull request](https://github.com/chriskuehl/identify)! +[submit a pull request](https://github.com/pre-commit/identify)! `types` and `files` are evaluated with `AND` when filtering. Tags within `types` are also evaluated using `AND`. From 75fe0527b2d12d157183171baf6de60b012c6854 Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Thu, 24 Sep 2020 21:59:42 +0200 Subject: [PATCH 008/490] Adds pydantic to schema hook --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index 8d14f6f8..d63ffe74 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -143,3 +143,4 @@ - https://github.com/radix-ai/auto-smart-commit - https://github.com/thibaudcolas/curlylint - https://github.com/cheshirekow/cmake-format-precommit +- https://github.com/aorumbayev/pydantic-to-schema From aae2fe5813fe68b5058100beabc28837654ee222 Mon Sep 17 00:00:00 2001 From: Ethan Glasser-Camp Date: Fri, 25 Sep 2020 17:33:42 -0400 Subject: [PATCH 009/490] Use the "literal" block style instead of the "folded" one Verbose regular expressions allow comments, but if we use "folded" multiline strings, then the comment will also comment out the remainder of the regular expression. --- index.mako | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.mako b/index.mako index 4a279d6e..4846c355 100644 --- a/index.mako +++ b/index.mako @@ -1477,7 +1477,7 @@ the `(?x)` regex flag. ```yaml # ... - id: my-hook - exclude: > + exclude: | (?x)^( path/to/file1.py| path/to/file2.py| From 1216c60abf000dffda6948e22236a24b79c65fc5 Mon Sep 17 00:00:00 2001 From: Ruairidh MacLeod Date: Sun, 27 Sep 2020 23:11:34 +0000 Subject: [PATCH 010/490] add dotnet language entry --- index.mako | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.mako b/index.mako index 4846c355..973f22dd 100644 --- a/index.mako +++ b/index.mako @@ -534,6 +534,7 @@ Hello from foo hook! - [conda](#conda) - [docker](#docker) - [docker_image](#docker_image) +- [dotnet](#dotnet) - [fail](#fail) - [golang](#golang) - [node](#node) @@ -615,6 +616,16 @@ For example: entry: my.registry.example.com/docker-image-3:latest my-exe ``` +### dotnet + +_new in 2.8.0_ + +dotnet hooks are installed using the system installation of the dotnet CLI. + +Hook repositories must contain a dotnet CLI tool which can be `pack`ed and `install`ed as per [this](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools-how-to-create) example. The `entry` should match an executable created by building the repository. Additional dependencies are not currently supported. + +__Support:__ dotnet hooks are known to work on any system which has the dotnet CLI installed. It has been tested on linux and windows. + ### fail _new in 1.11.0_ From 4cd6054766ce2c05a2e70530a1fed49a8c2ead92 Mon Sep 17 00:00:00 2001 From: Hadi Zaki Alqattan Date: Sat, 3 Oct 2020 20:28:35 +0300 Subject: [PATCH 011/490] Add pycln to the list of hook repos. --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index d63ffe74..57fd5bbd 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -144,3 +144,4 @@ - https://github.com/thibaudcolas/curlylint - https://github.com/cheshirekow/cmake-format-precommit - https://github.com/aorumbayev/pydantic-to-schema +- https://github.com/hadialqattan/pycln From be6409390467bf82d08c4a7367ec55f3ec5a28f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?= Date: Wed, 7 Oct 2020 10:40:03 +0200 Subject: [PATCH 012/490] Update isort repository link --- all-repos.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all-repos.yaml b/all-repos.yaml index 57fd5bbd..06e8691f 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -88,7 +88,7 @@ - https://github.com/syntaqx/git-hooks - https://github.com/Calinou/pre-commit-luacheck - https://github.com/belminf/pre-commit-chef -- https://github.com/timothycrosley/isort +- https://github.com/PyCQA/isort - https://github.com/pocc/pre-commit-hooks - https://github.com/dwightgunning/pre-commit-nglint - https://github.com/codespell-project/codespell From 39dfd9077ae4a69e652611a014a3e229ac0456cc Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Fri, 9 Oct 2020 15:01:26 +0100 Subject: [PATCH 013/490] Add nbQA to list of hooks --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index 06e8691f..b84adcb8 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -145,3 +145,4 @@ - https://github.com/cheshirekow/cmake-format-precommit - https://github.com/aorumbayev/pydantic-to-schema - https://github.com/hadialqattan/pycln +- https://github.com/nbQA-dev/nbQA From b5ad0c983b115757e920ca373ae49d8766809ca2 Mon Sep 17 00:00:00 2001 From: erfannariman Date: Wed, 7 Oct 2020 23:43:45 +0200 Subject: [PATCH 014/490] add explanation about local hook and arguments --- index.mako | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/index.mako b/index.mako index 4846c355..c048cb26 100644 --- a/index.mako +++ b/index.mako @@ -444,7 +444,7 @@ file that tells pre-commit: the hook passes. _new in 1.6.0_. =r= =c= [`pass_filenames`](_#hooks-pass_filenames) - =c= (optional: default `true`) if `false` no arguments will be passed to + =c= (optional: default `true`) if `false` no filenames will be passed to the hook. =r= =c= [`require_serial`](_#hooks-require_serial) @@ -1267,6 +1267,22 @@ If the [`args`](#config-args) property is empty or not defined, your script will path/to/script-or-system-exe dir/file1 dir/file2 file3 ``` +When creating local hooks, there's no reason to put command arguments +into [`args`](#config-args) as there is nothing which can override them -- +instead put your arguments directly in the hook [`entry`](#hooks-entry). + +For example: + +```yaml +- repo: local + hooks: + - id: check-requirements + name: check requirements files + language: system + entry: python -m scripts.check_requirements --compare + files: ^requirements.*.txt$ +``` + ## Repository local hooks Repository-local hooks are useful when: From 5fe33f5c9def9d4d217f1b153bd18e05b5f768b6 Mon Sep 17 00:00:00 2001 From: Ruairidh MacLeod Date: Wed, 21 Oct 2020 15:56:52 +0100 Subject: [PATCH 015/490] Update prettier hook repo See https://github.com/prettier/prettier/issues/9459 --- all-repos.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all-repos.yaml b/all-repos.yaml index b84adcb8..42b750c0 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -54,7 +54,7 @@ - https://github.com/awebdeveloper/pre-commit-stylelint - https://github.com/awebdeveloper/pre-commit-tslint - https://github.com/awebdeveloper/pre-commit-prettier -- https://github.com/prettier/prettier +- https://github.com/prettier/pre-commit - https://github.com/adrienverge/yamllint - https://github.com/thlorenz/doctoc - https://github.com/noahsark769/xcodeproj-sort-pre-commit-hook From ac59d040ece23238628790afe24cbaefe48ae6f8 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 28 Oct 2020 22:30:40 -0700 Subject: [PATCH 016/490] documentation updates for 2.8.0 --- base.mako | 2 +- index.mako | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/base.mako b/base.mako index 640d2add..c238a9e1 100644 --- a/base.mako +++ b/base.mako @@ -46,7 +46,7 @@

A framework for managing and maintaining multi-language pre-commit hooks.

Build Status Azure DevOps Coverage -pre-commit

+pre-commit.ci status

diff --git a/index.mako b/index.mako index e6d2aecc..73113cf1 100644 --- a/index.mako +++ b/index.mako @@ -77,6 +77,14 @@ requirements-dev.txt): pre-commit ``` +As a 0-dependency [zipapp]: + +- locate and download the `.pyz` file from the [github releases] +- run `python pre-commit-#.#.#.pyz ...` in place of `pre-commit ...` + +[zipapp]: https://docs.python.org/3/library/zipapp.html +[github releases]: https://github.com/pre-commit/pre-commit/releases + Using [homebrew](https://brew.sh): ```bash @@ -532,6 +540,7 @@ Hello from foo hook! ## Supported languages - [conda](#conda) +- [coursier](#coursier) - [docker](#docker) - [docker_image](#docker_image) - [dotnet](#dotnet) @@ -563,6 +572,13 @@ __Support:__ `conda` hooks work as long as there is a system-installed `conda` binary (such as [`miniconda`](https://docs.conda.io/en/latest/miniconda.html)). It has been tested on linux, macOS, and windows. +### coursier + +_new in 2.8.0_ + +__Support:__ `coursier` hooks are known to work on any system which has the `cs` +package manager installed. It has been tested on linux. + ### docker The hook repository must have a `Dockerfile`. It will be installed via @@ -622,9 +638,13 @@ _new in 2.8.0_ dotnet hooks are installed using the system installation of the dotnet CLI. -Hook repositories must contain a dotnet CLI tool which can be `pack`ed and `install`ed as per [this](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools-how-to-create) example. The `entry` should match an executable created by building the repository. Additional dependencies are not currently supported. +Hook repositories must contain a dotnet CLI tool which can be `pack`ed and +`install`ed as per [this](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools-how-to-create) +example. The `entry` should match an executable created by building the +repository. Additional dependencies are not currently supported. -__Support:__ dotnet hooks are known to work on any system which has the dotnet CLI installed. It has been tested on linux and windows. +__Support:__ dotnet hooks are known to work on any system which has the dotnet +CLI installed. It has been tested on linux and windows. ### fail @@ -770,6 +790,7 @@ the regex as the [`entry`](#hooks-entry). The [`entry`](#hooks-entry) may be an can apply the `(?i)` flag as the start of your entry, or use `args: [-i]`. _new in 1.8.0_: For multiline matches, use `args: [--multiline]`. +_new in 2.8.0_: To require all files to match, use `args: [--negate]`. __Support:__ pygrep hooks are supported on all platforms which pre-commit runs on. @@ -809,6 +830,11 @@ All pre-commit commands take the following options: - `-c CONFIG`, `--config CONFIG`: path to alternate config file - `-h`, `--help`: show help and available options. +_new in 2.8.0_: `pre-commit` now exits with more specific codes: +- `1`: a detected / expected error +- `3`: an unexpected error +- `130`: the process was interrupted by `^C` + ## pre-commit autoupdate [options] [](#pre-commit-autoupdate) Auto-update pre-commit config to the latest repos' versions. From 58b6eab84de1cddb5b227125d909b7bf5aa01d72 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 28 Oct 2020 22:59:41 -0700 Subject: [PATCH 017/490] replace azure pipelines with pre-commit.ci --- README.md | 2 +- azure-pipelines.yml | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/README.md b/README.md index 99c0da9a..4942a13b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ pre-commit.com ============== -[![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/pre-commit.pre-commit.com?branchName=master)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=64&branchName=master) +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pre-commit/pre-commit.com/master.svg)](https://results.pre-commit.ci/latest/github/pre-commit/pre-commit.com/master) [![Build Status](https://github.com/pre-commit/pre-commit.com/workflows/deploy/badge.svg)](https://github.com/pre-commit/pre-commit.com/actions) This powers https://pre-commit.com diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 416cca42..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,16 +0,0 @@ -trigger: - branches: - include: [master, test-me-*] - tags: - include: ['*'] - -resources: - repositories: - - repository: asottile - type: github - endpoint: github - name: asottile/azure-pipeline-templates - ref: refs/tags/v1.0.0 - -jobs: -- template: job--pre-commit.yml@asottile From 2b27fa34aace7e1d5375af6a86f7f90ad056c122 Mon Sep 17 00:00:00 2001 From: Tomer Date: Fri, 30 Oct 2020 15:39:30 +0200 Subject: [PATCH 018/490] Add godot gdscript toolkit to hooks list --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index 42b750c0..de921d82 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -146,3 +146,4 @@ - https://github.com/aorumbayev/pydantic-to-schema - https://github.com/hadialqattan/pycln - https://github.com/nbQA-dev/nbQA +- https://github.com/Scony/godot-gdscript-toolkit From ddadd113023258d424cb35ff3aadd1953e8df650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Avila?= Date: Mon, 2 Nov 2020 10:18:14 -0300 Subject: [PATCH 019/490] Add add-msg-issue-preffix-hook to supported The hook searches the current branch for something looking like a jira issue and prepends the commit message. It is a prepare-commit-msg hook. --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index de921d82..47513395 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -147,3 +147,4 @@ - https://github.com/hadialqattan/pycln - https://github.com/nbQA-dev/nbQA - https://github.com/Scony/godot-gdscript-toolkit +- https://github.com/avilaton/add-msg-issue-prefix-hook From c3e0216adeccaeae23f34e0ec63a1df23a0df61f Mon Sep 17 00:00:00 2001 From: Dustin Shimono <5289+dustinsand@users.noreply.github.com> Date: Mon, 2 Nov 2020 17:13:45 -0500 Subject: [PATCH 020/490] add repo to JVM hooks Currently contains one hook to run Detekt on Kotlin source files. --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index 47513395..f74cc524 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -148,3 +148,4 @@ - https://github.com/nbQA-dev/nbQA - https://github.com/Scony/godot-gdscript-toolkit - https://github.com/avilaton/add-msg-issue-prefix-hook +- https://github.com/dustinsand/pre-commit-jvm From e1ff2468ea81b3d49cc2449c172702bd403b2d9e Mon Sep 17 00:00:00 2001 From: Joseph Moniz Date: Fri, 6 Nov 2020 10:40:55 -0500 Subject: [PATCH 021/490] first pass at coursier doc --- index.mako | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.mako b/index.mako index 73113cf1..cfce8a9b 100644 --- a/index.mako +++ b/index.mako @@ -576,8 +576,17 @@ It has been tested on linux, macOS, and windows. _new in 2.8.0_ +The hook repository muist have a `.pre-commit-channel` folder and that folder must contain +the coursier +[application descriptors](https://get-coursier.io/docs/2.0.0-RC6-10/cli-install.html#application-descriptor-reference) +for the hook to install. For configuring coursier hooks, your +[`entry`](#hooks-entry) should correspond to an executable installed from the +repositories `.pre-commit-channel` folder. + __Support:__ `coursier` hooks are known to work on any system which has the `cs` -package manager installed. It has been tested on linux. +package manager installed. The specific coursier applications you install may depend +on various versions of the JVM, consult the hooks documentation for clarificaiton. +This integration has been tested on linus ### docker From d7edd1aaf63afbc538c556597bdb5803005107aa Mon Sep 17 00:00:00 2001 From: Christian Knittl-Frank Date: Fri, 6 Nov 2020 18:18:51 +0100 Subject: [PATCH 022/490] Add CleverCSV to list of repos This PR adds the CleverCSV mirror repository --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index f74cc524..c2f4d5bd 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -149,3 +149,4 @@ - https://github.com/Scony/godot-gdscript-toolkit - https://github.com/avilaton/add-msg-issue-prefix-hook - https://github.com/dustinsand/pre-commit-jvm +- https://github.com/alan-turing-institute/CleverCSV-pre-commit From 599d0bd765b8b461f92b85dfc9a29a34e0928ada Mon Sep 17 00:00:00 2001 From: Joseph Date: Fri, 6 Nov 2020 13:04:50 -0500 Subject: [PATCH 023/490] Apply suggestions from code review Co-authored-by: Anthony Sottile --- index.mako | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.mako b/index.mako index cfce8a9b..6c7537c9 100644 --- a/index.mako +++ b/index.mako @@ -576,17 +576,17 @@ It has been tested on linux, macOS, and windows. _new in 2.8.0_ -The hook repository muist have a `.pre-commit-channel` folder and that folder must contain +The hook repository must have a `.pre-commit-channel` folder and that folder must contain the coursier [application descriptors](https://get-coursier.io/docs/2.0.0-RC6-10/cli-install.html#application-descriptor-reference) for the hook to install. For configuring coursier hooks, your [`entry`](#hooks-entry) should correspond to an executable installed from the -repositories `.pre-commit-channel` folder. +repository's `.pre-commit-channel` folder. __Support:__ `coursier` hooks are known to work on any system which has the `cs` package manager installed. The specific coursier applications you install may depend -on various versions of the JVM, consult the hooks documentation for clarificaiton. -This integration has been tested on linus +on various versions of the JVM, consult the hooks' documentation for clarification. +It has been tested on linux. ### docker From 577c868379b4c5bb6df99ace6c7b38210d9e8405 Mon Sep 17 00:00:00 2001 From: joshvernon Date: Fri, 6 Nov 2020 19:41:01 -0600 Subject: [PATCH 024/490] Add elixir-pre-commit-hooks to all_repos.yaml --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index c2f4d5bd..7ec60fbe 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -150,3 +150,4 @@ - https://github.com/avilaton/add-msg-issue-prefix-hook - https://github.com/dustinsand/pre-commit-jvm - https://github.com/alan-turing-institute/CleverCSV-pre-commit +- https://gitlab.com/jvenom/elixir-pre-commit-hooks From 8cbd8da9409f3f277c6689abd0e4242db67cc67e Mon Sep 17 00:00:00 2001 From: Milind Shakya Date: Sun, 8 Nov 2020 19:12:22 -0500 Subject: [PATCH 025/490] Add gitown --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index 7ec60fbe..4bdf8867 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -81,6 +81,7 @@ - https://github.com/miki725/importanize - https://github.com/motet-a/jinjalint - https://github.com/milin/giticket +- https://github.com/milin/gitown - https://github.com/sqlalchemyorg/zimports - https://github.com/peterdemin/pip-compile-multi - https://github.com/homebysix/pre-commit-macadmin From d550016665ca3d93633e22ec026a4041ffd4202e Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 15 Nov 2020 10:04:35 -0800 Subject: [PATCH 026/490] Use pre-commit's mirrors-prettier --- all-repos.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/all-repos.yaml b/all-repos.yaml index 4bdf8867..dd88399b 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -7,6 +7,7 @@ - https://github.com/pre-commit/mirrors-fixmyjs - https://github.com/pre-commit/mirrors-jshint - https://github.com/pre-commit/mirrors-mypy +- https://github.com/pre-commit/mirrors-prettier - https://github.com/pre-commit/mirrors-puppet-lint - https://github.com/pre-commit/mirrors-ruby-lint - https://github.com/pre-commit/mirrors-scss-lint @@ -53,8 +54,6 @@ - https://github.com/kintoandar/pre-commit - https://github.com/awebdeveloper/pre-commit-stylelint - https://github.com/awebdeveloper/pre-commit-tslint -- https://github.com/awebdeveloper/pre-commit-prettier -- https://github.com/prettier/pre-commit - https://github.com/adrienverge/yamllint - https://github.com/thlorenz/doctoc - https://github.com/noahsark769/xcodeproj-sort-pre-commit-hook From 7e50c081cfd9d6caadfc67fc24ca853109fe1c3f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2020 17:07:34 +0000 Subject: [PATCH 027/490] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 186801ac..50775fd3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,21 +1,21 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.5.0 + rev: v3.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: debug-statements - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.0 + rev: 3.8.4 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5.2 + rev: v1.5.4 hooks: - id: autopep8 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.3.0 + rev: v2.3.6 hooks: - id: reorder-python-imports args: [--py36-plus] @@ -23,7 +23,7 @@ repos: - id: reorder-python-imports files: install-local.py - repo: https://github.com/asottile/pyupgrade - rev: v2.4.1 + rev: v2.7.4 hooks: - id: pyupgrade args: [--py36-plus] @@ -35,11 +35,11 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.770 + rev: v0.790 hooks: - id: mypy - repo: https://github.com/pre-commit/mirrors-eslint - rev: v7.0.0 + rev: v7.13.0-1 hooks: - id: eslint args: [--fix] From 2d85a86a97748b49626704ea08c4a5bea571734e Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 19 Nov 2020 17:13:21 -0800 Subject: [PATCH 028/490] Add link to GitHub Sponsors + Open Collective at the time of writing I am currently unemployed. I'd love to make open source a full time career. if you or your company is deriving value from this free software, please consider [sponsoring] or [supporting]. [sponsoring]: https://github.com/sponsors/asottile [supporting]: https://opencollective.com/pre-commit Committed via https://github.com/asottile/all-repos --- .github/FUNDING.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..9408e44d --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: asottile +open_collective: pre-commit From 46b512610fd2d8fbefab7c2526fe654059969cfc Mon Sep 17 00:00:00 2001 From: Serge Matveenko Date: Fri, 20 Nov 2020 19:27:57 +0300 Subject: [PATCH 029/490] Add some Dart/Flutter related hooks to `all-repos.yaml` --- all-repos.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/all-repos.yaml b/all-repos.yaml index dd88399b..3b9a24a8 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -151,3 +151,6 @@ - https://github.com/dustinsand/pre-commit-jvm - https://github.com/alan-turing-institute/CleverCSV-pre-commit - https://gitlab.com/jvenom/elixir-pre-commit-hooks +- https://github.com/Cretezy/flutter-format-pre-commit +- https://github.com/dluksza/flutter-analyze-pre-commit +- https://github.com/fluttercommunity/import_sorter From 424a1228f90766622500fd8365d03678f1b0d9a6 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 20 Nov 2020 13:06:59 -0800 Subject: [PATCH 030/490] upgrade mistune to 2.x --- index.mako | 22 +++++++++++----------- requirements-dev.txt | 4 +--- template_lib.py | 27 ++++++++++++++------------- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/index.mako b/index.mako index 6c7537c9..051ac94b 100644 --- a/index.mako +++ b/index.mako @@ -844,7 +844,7 @@ _new in 2.8.0_: `pre-commit` now exits with more specific codes: - `3`: an unexpected error - `130`: the process was interrupted by `^C` -## pre-commit autoupdate [options] [](#pre-commit-autoupdate) +## pre-commit autoupdate [options] #pre-commit-autoupdate Auto-update pre-commit config to the latest repos' versions. @@ -901,13 +901,13 @@ $ grep rev: .pre-commit-config.yaml rev: 34a269fd7650d264e4de7603157c10d0a9bb8211 # frozen: v1.25.2 ``` -## pre-commit clean [options] [](#pre-commit-clean) +## pre-commit clean [options] #pre-commit-clean Clean out cached pre-commit files. Options: (no additional options) -## pre-commit gc [options] [](#pre-commit-gc) +## pre-commit gc [options] #pre-commit-gc _new in 1.14.0_ @@ -919,7 +919,7 @@ the cache directory. Options: (no additional options) -## pre-commit init-templatedir DIRECTORY [options] [](#pre-commit-init-templatedir) +## pre-commit init-templatedir DIRECTORY [options] #pre-commit-init-templatedir _new in 1.18.0_ @@ -942,7 +942,7 @@ pre-commit init-templatedir ~/.git-template Now whenever a repository is cloned or created, it will have the hooks set up already! -## pre-commit install [options] [](#pre-commit-install) +## pre-commit install [options] #pre-commit-install Install the pre-commit script. @@ -967,7 +967,7 @@ Some example useful invocations: existing git hook scripts with pre-commit, and also installs hook environments. -## pre-commit install-hooks [options] [](#pre-commit-install-hooks) +## pre-commit install-hooks [options] #pre-commit-install-hooks Install all missing environments for the available hooks. Unless this command or `install --install-hooks` is executed, each hook's environment is created the @@ -981,7 +981,7 @@ the hook environments in one command, use `pre-commit install --install-hooks`. Options: (no additional options) -## pre-commit migrate-config [options] [](#pre-commit-migrate-config) +## pre-commit migrate-config [options] #pre-commit-migrate-config _new in 1.0.0_ @@ -989,7 +989,7 @@ Migrate list configuration to the new map configuration format. Options: (no additional options) -## pre-commit run [hook-id] [options] [](#pre-commit-run) +## pre-commit run [hook-id] [options] #pre-commit-run Run hooks. @@ -1019,13 +1019,13 @@ Some example useful invocations: have changed between `HEAD^^^` and `HEAD`. This form is useful when leveraged in a pre-receive hook. -## pre-commit sample-config [options] [](#pre-commit-sample-config) +## pre-commit sample-config [options] #pre-commit-sample-config Produce a sample `.pre-commit-config.yaml`. Options: (no additional options) -## pre-commit try-repo REPO [options] [](#pre-commit-try-repo) +## pre-commit try-repo REPO [options] #pre-commit-try-repo _new in 1.3.0_ @@ -1053,7 +1053,7 @@ Some example useful invocations: - See [`pre-commit run`](#pre-commit-run) for more useful `run` invocations which are also supported by `pre-commit try-repo`. -## pre-commit uninstall [options] [](#pre-commit-uninstall) +## pre-commit uninstall [options] #pre-commit-uninstall Uninstall the pre-commit script. diff --git a/requirements-dev.txt b/requirements-dev.txt index 2f9cb64c..928973ba 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,6 @@ mako libsass -markdown-code-blocks +markdown-code-blocks>=3.0.0 markdown-to-presentation>=0.0.12 -# remove once merged and release -git+https://github.com/lepture/mistune@449c2b5 pre-commit>=1.21.0 pygments-pre-commit>=1.4.0 diff --git a/template_lib.py b/template_lib.py index dfb0a692..1ddabf66 100644 --- a/template_lib.py +++ b/template_lib.py @@ -9,7 +9,7 @@ import markupsafe -ID_RE = re.compile(r'\[\]\(#([a-z0-9-]+)\)') +ID_RE = re.compile(r' #([a-z0-9-]+)$') SPECIAL_CHARS_RE = re.compile('[^a-z0-9 _-]') @@ -94,16 +94,17 @@ def link( ) -> str: if link.startswith(SELF_LINK_PREFIX): a_id = link[len(SELF_LINK_PREFIX):] - return f'{title}' + return f'{text}' else: return super().link(link, text, title) - def header(self, text: str, level: int, raw: str) -> str: - match = ID_RE.search(raw) + def heading(self, text: str, level: int) -> str: + match = ID_RE.search(text) + text = ID_RE.sub('', text) if match: - h_id = match.group(1) + h_id = match[1] else: - h_id = SPECIAL_CHARS_RE.sub('', raw.lower()).replace(' ', '-') + h_id = SPECIAL_CHARS_RE.sub('', text.lower()).replace(' ', '-') return ( f'' f' {text} ' @@ -117,18 +118,18 @@ def codespan(self, text: str) -> str: else: return super().codespan(text) - def block_code(self, code: str, lang: Optional[str]) -> str: + def block_code(self, code: str, info: Optional[str] = None) -> str: copyable = False - if lang is not None: + if info is not None: copyable_s = '#copyable' - copyable = lang.endswith(copyable_s) - lang, _, _ = lang.partition(copyable_s) - if lang == 'table': + copyable = info.endswith(copyable_s) + info, _, _ = info.partition(copyable_s) + if info == 'table': ret = _render_table(code) - elif lang == 'cmd': + elif info == 'cmd': ret = _render_cmd(code) else: - ret = super().block_code(code, lang) + ret = super().block_code(code, info) if copyable: return f'

{ret}
' else: From 48d64d424195f371f89d748c326e934e18f4d58a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 20 Nov 2020 15:05:50 -0800 Subject: [PATCH 031/490] hide paragraph marker unless hovered --- scss/main.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scss/main.scss b/scss/main.scss index 514a67f1..22838ffb 100644 --- a/scss/main.scss +++ b/scss/main.scss @@ -213,3 +213,15 @@ h1, display: block; } } + +h1, +h2, +h3 { + small { + display: none; + } + + &:hover small { + display: inline; + } +} From 5e5e8e787cbaa82ac949b6e5b4c0b3601c0109e5 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 21 Nov 2020 13:45:43 -0800 Subject: [PATCH 032/490] documentation updates for 2.9.0 --- index.mako | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/index.mako b/index.mako index 051ac94b..80d4e996 100644 --- a/index.mako +++ b/index.mako @@ -309,7 +309,11 @@ repository's configuration. =c= (optional) file exclude pattern. =r= =c= [`types`](_#config-types) - =c= (optional) override the default file types to run on. See + =c= (optional) override the default file types to run on (AND). See + [Filtering files with types](#filtering-files-with-types). +=r= + =c= [`types_or`](_#config-types_or) + =c= (optional) override the default file types to run on (OR). See [Filtering files with types](#filtering-files-with-types). =r= =c= [`exclude_types`](_#config-exclude_types) @@ -437,7 +441,11 @@ file that tells pre-commit: =c= (optional: default `^$`) exclude files that were matched by [`files`](#hooks-files). =r= =c= [`types`](_#hooks-types) - =c= (optional: default `[file]`) list of file types to run on. See + =c= (optional: default `[file]`) list of file types to run on (AND). See + [Filtering files with types](#filtering-files-with-types). +=r= + =c= [`types_or`](_#hooks-types_or) + =c= (optional: default `[file]`) list of file types to run on (OR). See [Filtering files with types](#filtering-files-with-types). =r= =c= [`exclude_types`](_#hooks-exclude_types) @@ -1490,8 +1498,9 @@ $ identify-cli --filename-only some-random-file; echo $? If a file extension you use is not supported, please [submit a pull request](https://github.com/pre-commit/identify)! -`types` and `files` are evaluated with `AND` when filtering. Tags within -`types` are also evaluated using `AND`. +`types`, `types_or`, and `files` are evaluated together with `AND` when +filtering. Tags within `types` are also evaluated using `AND`. +Tags within `types_or` are evaluated using `OR`. For example: @@ -1502,6 +1511,16 @@ For example: will match a file `foo/1.py` but will not match `setup.py`. +Another example: + +```yaml + files: ^foo/ + types_or: [javascript, jsx, ts, tsx] +``` + +will match any of `foo/bar.js` / `foo/bar.jsx` / `foo/bar.ts` / `foo/bar.tsx` +but not `baz.js`. + If you want to match a file path that isn't included in a `type` when using an existing hook you'll need to revert back to `files` only matching by overriding the `types` setting. Here's an example of using `check-json` against non-json @@ -1816,6 +1835,14 @@ forks / mirrors. Feel free to submit bug reports, pull requests, and feature requests. +## Sponsoring + +If you or your company would like to support the development of pre-commit one +can contribute in the following ways: + +- [GitHub Sponsors (asottile)](https://github.com/sponsors/asottile) +- [Open Collective](https://opencollective.com/pre-commit) + ## Getting help There are several ways to get help for pre-commit: From 7a28f1e6ad0e0fdaf68e1ec07cee06cf3631db74 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 21 Nov 2020 14:06:54 -0800 Subject: [PATCH 033/490] add the "new in" text for `types_or` --- index.mako | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.mako b/index.mako index 80d4e996..1e97fa87 100644 --- a/index.mako +++ b/index.mako @@ -315,6 +315,7 @@ repository's configuration. =c= [`types_or`](_#config-types_or) =c= (optional) override the default file types to run on (OR). See [Filtering files with types](#filtering-files-with-types). + _new in 2.9.0_. =r= =c= [`exclude_types`](_#config-exclude_types) =c= (optional) file types to exclude. @@ -447,6 +448,7 @@ file that tells pre-commit: =c= [`types_or`](_#hooks-types_or) =c= (optional: default `[file]`) list of file types to run on (OR). See [Filtering files with types](#filtering-files-with-types). + _new in 2.9.0_. =r= =c= [`exclude_types`](_#hooks-exclude_types) =c= (optional: default `[]`) exclude files that were matched by [`types`](#hooks-types). @@ -1500,7 +1502,8 @@ If a file extension you use is not supported, please `types`, `types_or`, and `files` are evaluated together with `AND` when filtering. Tags within `types` are also evaluated using `AND`. -Tags within `types_or` are evaluated using `OR`. + +_new in 2.9.0_: Tags within `types_or` are evaluated using `OR`. For example: From 3393589d6b68469bb4b271a3d7dbec0c756b27d6 Mon Sep 17 00:00:00 2001 From: Manuel Leonhardt Date: Sun, 22 Nov 2020 21:04:26 +0100 Subject: [PATCH 034/490] Add editorconfig-checker hooks repo editorconfig-checker is tool to verify that your files are in harmony with your .editorconfig. --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index 3b9a24a8..ed56705b 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -154,3 +154,4 @@ - https://github.com/Cretezy/flutter-format-pre-commit - https://github.com/dluksza/flutter-analyze-pre-commit - https://github.com/fluttercommunity/import_sorter +- https://github.com/editorconfig-checker/editorconfig-checker.python From 21b694a9e30e09636f61d24424545eb9adf0f4f4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Nov 2020 16:40:45 +0000 Subject: [PATCH 035/490] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 50775fd3..fe2b639f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: hooks: - id: mypy - repo: https://github.com/pre-commit/mirrors-eslint - rev: v7.13.0-1 + rev: v7.14.0 hooks: - id: eslint args: [--fix] From 85d3b7adf50232295bbe16304afae76c234ff7e6 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 25 Nov 2020 20:28:36 -0800 Subject: [PATCH 036/490] correct default for types_or (2.9.2) --- index.mako | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.mako b/index.mako index 1e97fa87..d80c6585 100644 --- a/index.mako +++ b/index.mako @@ -446,7 +446,7 @@ file that tells pre-commit: [Filtering files with types](#filtering-files-with-types). =r= =c= [`types_or`](_#hooks-types_or) - =c= (optional: default `[file]`) list of file types to run on (OR). See + =c= (optional: default `[]`) list of file types to run on (OR). See [Filtering files with types](#filtering-files-with-types). _new in 2.9.0_. =r= From ec8e42556183ff2c92aeb89a4fee92e246c46f08 Mon Sep 17 00:00:00 2001 From: Finn Bayer Date: Sun, 29 Nov 2020 00:52:55 +0100 Subject: [PATCH 037/490] added init-templatedir example windows cmd/ps added example which uses windows environment variables instead of the ~ --- index.mako | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.mako b/index.mako index d80c6585..271f6472 100644 --- a/index.mako +++ b/index.mako @@ -949,6 +949,18 @@ git config --global init.templateDir ~/.git-template pre-commit init-templatedir ~/.git-template ``` +For Windows cmd.exe use `%HOMEPATH%` instead of `~`: + +```batch +pre-commit init-templatedir %HOMEPATH%\.git-template +``` + +For Windows PowerShell use `$HOME` instead of `~`: + +```powershell +pre-commit init-templatedir $HOME\.git-template +``` + Now whenever a repository is cloned or created, it will have the hooks set up already! From a25c5346ff40627865c2b68bdceba3be5609870e Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Tue, 1 Dec 2020 23:41:58 +0700 Subject: [PATCH 038/490] Fix GitHub actions example Use set-output instead of set-env, since it is removed from GHA. --- index.mako | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.mako b/index.mako index 271f6472..40fd073e 100644 --- a/index.mako +++ b/index.mako @@ -1729,7 +1729,7 @@ immutable caches: ```yaml - name: set PY - run: echo "::set-env name=PY::$(python -VV | sha256sum | cut -d' ' -f1)" + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - uses: actions/cache@v1 with: path: ~/.cache/pre-commit From 5d195c870ad08de4360fc478a6958e499dc89b44 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Dec 2020 20:30:37 +0000 Subject: [PATCH 039/490] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe2b639f..4dc20bdd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: hooks: - id: mypy - repo: https://github.com/pre-commit/mirrors-eslint - rev: v7.14.0 + rev: v7.15.0 hooks: - id: eslint args: [--fix] From 411e4031c81103670478d31aac9717975c406f9e Mon Sep 17 00:00:00 2001 From: Pablo Diehl Date: Thu, 10 Dec 2020 08:25:58 -0300 Subject: [PATCH 040/490] Add pre-commit-lua-formatter hook This commit adds a hook that runs LuaFormatter on Lua files. --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index ed56705b..93a1d99b 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -155,3 +155,4 @@ - https://github.com/dluksza/flutter-analyze-pre-commit - https://github.com/fluttercommunity/import_sorter - https://github.com/editorconfig-checker/editorconfig-checker.python +- https://gitlab.com/pablodiehl/pre-commit-lua-formatter From 16dce8fbd4ce19d25ac8fc49f39b51084ef9ad67 Mon Sep 17 00:00:00 2001 From: Franco Masotti Date: Sat, 19 Dec 2020 17:45:07 +0100 Subject: [PATCH 041/490] Add md-toc hook. --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index 93a1d99b..a1cc8bef 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -156,3 +156,4 @@ - https://github.com/fluttercommunity/import_sorter - https://github.com/editorconfig-checker/editorconfig-checker.python - https://gitlab.com/pablodiehl/pre-commit-lua-formatter +- https://github.com/frnmst/md-toc From 75b8c5326cb4e041b7d95632cc0b433e1bd60c1c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Dec 2020 16:43:59 +0000 Subject: [PATCH 042/490] [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4dc20bdd..140fb442 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.3.0 + rev: v3.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -39,7 +39,7 @@ repos: hooks: - id: mypy - repo: https://github.com/pre-commit/mirrors-eslint - rev: v7.15.0 + rev: v7.16.0 hooks: - id: eslint args: [--fix] From 5e6a362a1f42fed5d729dd3618ec4b0d9fd03395 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 23 Dec 2020 12:39:41 -0800 Subject: [PATCH 043/490] Add check-manifest --- all-repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/all-repos.yaml b/all-repos.yaml index a1cc8bef..892922a6 100644 --- a/all-repos.yaml +++ b/all-repos.yaml @@ -157,3 +157,4 @@ - https://github.com/editorconfig-checker/editorconfig-checker.python - https://gitlab.com/pablodiehl/pre-commit-lua-formatter - https://github.com/frnmst/md-toc +- https://github.com/mgedmin/check-manifest From 9e5482a57b5df5374d2a96d687fc3666a4805868 Mon Sep 17 00:00:00 2001 From: Paul Fischer Date: Sat, 19 Dec 2020 09:37:50 +0100 Subject: [PATCH 044/490] added id and type filter for hooks --- assets/filter_repos.js | 41 +++++++++++++++++++++++++++++++++++++++++ hooks.mako | 26 +++++++++++++++++++++++--- make_templates.py | 9 ++++++++- 3 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 assets/filter_repos.js diff --git a/assets/filter_repos.js b/assets/filter_repos.js new file mode 100644 index 00000000..be9fc414 --- /dev/null +++ b/assets/filter_repos.js @@ -0,0 +1,41 @@ +'use strict'; + +(() => { + const searchInput = document.getElementById('search-hook-id'); + const selectInput = document.getElementById('select-hook-type'); + + const hooks = document.getElementById('hooks'); + const repos = hooks.getElementsByTagName('ul'); + + const filterHooks = () => { + const id = searchInput.value.toLowerCase(); + const type = selectInput.value; + + for (let i = 0; i < repos.length; i += 1) { + const repo = repos[i]; + let hasVisibleHooks = false; + const repoHooks = repo.getElementsByTagName('li'); + + if (repoHooks) { + for (let j = 0; j < repoHooks.length; j += 1) { + const repoHook = repoHooks[j]; + const hookId = repoHook.dataset.id.toLowerCase(); + const hookTypes = repoHook.dataset.types; + + if (hookId.includes(id) && hookTypes.includes(type)) { + repoHook.hidden = false; + hasVisibleHooks = true; + } else { + repoHook.hidden = true; + } + } + } + + repo.hidden = !hasVisibleHooks; + hooks.querySelector(`h3[data-repo="${repo.dataset.repo}"]`).hidden = !hasVisibleHooks; + } + }; + + searchInput.addEventListener('input', filterHooks); + selectInput.addEventListener('change', filterHooks); +})(); diff --git a/hooks.mako b/hooks.mako index 5e180596..01645cca 100644 --- a/hooks.mako +++ b/hooks.mako @@ -3,6 +3,22 @@ +
+
+ + +
+
+ + +
+
+

To add to this list, fork this repository.

@@ -11,15 +27,16 @@ To add to this list, fork json.

+
% for repository, hooks in all_hooks.items(): -

+

${repository.replace('https://', '')}

-
    +
      % for hook_dict in hooks: -
    • +
    • ${hook_dict['id']} % if 'description' in hook_dict: - ${hook_dict['description']} @@ -30,3 +47,6 @@ Also available in json. % endfor
    % endfor +
+ + diff --git a/make_templates.py b/make_templates.py index 8935944a..e99db308 100644 --- a/make_templates.py +++ b/make_templates.py @@ -25,7 +25,14 @@ def get_env() -> Dict[str, Any]: open('all-hooks.json').read(), object_pairs_hook=collections.OrderedDict, ) - return {'all_hooks': all_hooks} + all_types = { + hook_type + for properties in all_hooks.values() + for hook_type in ( + properties[0].get("types", []) + properties[0].get("types_or", []) + ) + } + return {'all_hooks': all_hooks, 'all_types': all_types} def main() -> int: From 2206e3831e87c368aadc3dbf6f1669ff9b0fde1c Mon Sep 17 00:00:00 2001 From: Paul Fischer Date: Sat, 26 Dec 2020 22:02:01 +0100 Subject: [PATCH 045/490] updated to bootstrap 4 --- base.mako | 132 +++++++++++++++---------- hooks.mako | 10 +- index.mako | 24 ++--- logo.png | Bin 1629 -> 0 bytes package.json | 2 +- scss/_variables.scss | 48 ++++------ scss/main.scss | 224 +++++++++++++++---------------------------- 7 files changed, 196 insertions(+), 244 deletions(-) delete mode 100644 logo.png diff --git a/base.mako b/base.mako index c238a9e1..7ee61b16 100644 --- a/base.mako +++ b/base.mako @@ -2,69 +2,99 @@ - - - - - + + + + + + + pre-commit - - @@ -81,7 +81,7 @@
 
- + +${body} diff --git a/make_all_hooks.py b/make_all_hooks.py deleted file mode 100644 index a1bea4f4..00000000 --- a/make_all_hooks.py +++ /dev/null @@ -1,65 +0,0 @@ -from __future__ import annotations - -import functools -import json -import multiprocessing -import os.path -import subprocess -import tempfile -from typing import Any - -import yaml -from pre_commit.clientlib import load_manifest - -Loader = getattr(yaml, 'CSafeLoader', yaml.SafeLoader) -fast_load = functools.partial(yaml.load, Loader=Loader) - - -def get_manifest(repo_path: str) -> tuple[bool, str, list[dict[str, Any]]]: - print(f'*** {repo_path}') - with tempfile.TemporaryDirectory() as directory: - repo_dir = os.path.join(directory, 'repo') - cmd = ('git', 'clone', '--depth', '1', '-q', repo_path, repo_dir) - subprocess.check_call(cmd) - manifest_path = os.path.join(repo_dir, '.pre-commit-hooks.yaml') - # Validate the manifest just to make sure it's ok. - manifest = load_manifest(manifest_path) - for hook in manifest: - # hooks should not set debugging `verbose: true` flag - if hook['verbose']: - print(f'{repo_path} ({hook["id"]}) sets `verbose: true`') - return False, repo_path, [] - # hooks should not set `fail-fast` breaking user expectations - if hook['fail_fast']: - print(f'{repo_path} ({hook["id"]}) sets `fail_fast: true`') - return False, repo_path, [] - # hook names should be short and not cause wrapping by default - if ( - len(hook['name']) > 50 and - 'deprecated' not in hook['name'].lower() - ): - print(f'{repo_path} ({hook["id"]}) has too long `name` (>50)') - return False, repo_path, [] - - with open(manifest_path) as f: - return True, repo_path, fast_load(f) - - -def main() -> int: - with open('all-repos.yaml') as f: - repos = fast_load(f) - - hooks_json = {} - with multiprocessing.Pool(4) as pool: - for ok, path, manifest in pool.imap(get_manifest, repos): - if not ok: - return 1 - hooks_json[path] = manifest - - with open('all-hooks.json', 'w') as hooks_json_file: - json.dump(hooks_json, hooks_json_file, indent=4) - return 0 - - -if __name__ == '__main__': - raise SystemExit(main()) diff --git a/make_templates.py b/make_templates.py index 2e5c2de8..aca62aed 100644 --- a/make_templates.py +++ b/make_templates.py @@ -1,9 +1,6 @@ from __future__ import annotations -import collections -import json import os.path -from typing import Any import mako.lookup import markupsafe @@ -29,13 +26,7 @@ ) -ALL_TEMPLATES = [ - filename for filename in os.listdir('.') - if filename.endswith('.mako') and filename != 'base.mako' -] - - -def get_env() -> dict[str, Any]: +def index_body() -> markupsafe.Markup: body_parts = [] for title, filename in SECTIONS: div_id, _ = os.path.splitext(os.path.basename(filename)) @@ -50,30 +41,22 @@ def get_env() -> dict[str, Any]: f'\n', ), ) - body = markupsafe.Markup().join(body_parts) + return markupsafe.Markup().join(body_parts) - all_hooks = json.loads( - open('all-hooks.json').read(), - object_pairs_hook=collections.OrderedDict, - ) - all_types = { - hook_type - for properties in all_hooks.values() - for hook_type in ( - properties[0].get('types', []) + properties[0].get('types_or', []) - ) - } - return {'all_hooks': all_hooks, 'all_types': all_types, 'body': body} + +def hooks_body() -> markupsafe.Markup: + with open('sections/hooks.md') as f: + return md(f.read()) def main() -> int: - env = get_env() - for template in ALL_TEMPLATES: - template_name, _ = os.path.splitext(template) - env['template_name'] = template_name - with open(f'{template_name}.html', 'w') as html_file: - template_obj = template_lookup.get_template(template) - html_file.write(template_obj.render(**env)) + with open('index.html', 'w') as f: + tmpl = template_lookup.get_template('index.mako') + f.write(tmpl.render(body=index_body(), template_name='index')) + + with open('hooks.html', 'w') as f: + tmpl = template_lookup.get_template('hooks.mako') + f.write(tmpl.render(body=hooks_body(), template_name='hooks')) return 0 diff --git a/sections/hooks.md b/sections/hooks.md new file mode 100644 index 00000000..703bb5d3 --- /dev/null +++ b/sections/hooks.md @@ -0,0 +1,163 @@ +## featured hooks + +here are a few hand-picked repositories which provide pre-commit integrations. + +these are fairly popular and are generally known to work well in most setups! + +_this list is not intended to be exhaustive_ + +provided by the pre-commit team: +- [pre-commit/pre-commit-hooks]: a handful of language-agnostic hooks which + are universally useful! +- [pre-commit/pygrep-hooks]: a few quick regex-based hooks for a handful of + quick syntax checks +- [pre-commit/sync-pre-commit-deps]: sync pre-commit hook dependencies based + on other installed hooks +- [pre-commit/mirrors-*]: pre-commit mirrors of a handful of popular tools + +[pre-commit/pre-commit-hooks]: https://github.com/pre-commit/pre-commit-hooks +[pre-commit/pygrep-hooks]: https://github.com/pre-commit/pygrep-hooks +[pre-commit/sync-pre-commit-deps]: https://github.com/pre-commit/sync-pre-commit-deps +[pre-commit/mirrors-*]: https://github.com/orgs/pre-commit/repositories?language=&q=%22mirrors-%22+archived%3AFalse&sort= + +for python projects: +- [asottile/pyupgrade]: automatically upgrade syntax for newer versions of the + language +- [asottile/(others)]: a few other repos by the pre-commit creator +- [psf/black]: The uncompromising Python code formatter +- [hhatto/autopep8]: automatically fixes PEP8 violations +- [astral-sh/ruff-pre-commit]: the ruff linter and formatter for python +- [google/yapf]: a highly configurable python formatter +- [PyCQA/flake8]: a linter framework for python +- [PyCQA/isort]: an import sorter for python +- [PyCQA/(others)]: a few other python code quality tools +- [adamchainz/django-upgrade]: automatically upgrade your Django project code + +[asottile/pyupgrade]: https://github.com/asottile/pyupgrade +[asottile/(others)]: https://sourcegraph.com/search?q=context:global+file:%5E%5C.pre-commit-hooks%5C.yaml%24+repo:%5Egithub.com/asottile/ +[psf/black]: https://github.com/psf/black +[hhatto/autopep8]: https://github.com/hhatto/autopep8 +[astral-sh/ruff-pre-commit]: https://github.com/astral-sh/ruff-pre-commit +[google/yapf]: https://github.com/google/yapf +[PyCQA/flake8]: https://github.com/PyCQA/flake8 +[PyCQA/isort]: https://github.com/PyCQA/isort +[PyCQA/(others)]: https://sourcegraph.com/search?q=context:global+file:%5E%5C.pre-commit-hooks%5C.yaml%24+repo:%5Egithub.com/PyCQA/ +[adamchainz/django-upgrade]: https://github.com/adamchainz/django-upgrade + +for shell scripts: +- [shellcheck-py/shellcheck-py]: runs shellcheck on your scripts +- [openstack/bashate]: code style enforcement for bash programs + +[shellcheck-py/shellcheck-py]: https://github.com/shellcheck-py/shellcheck-py +[openstack/bashate]: https://github.com/openstack/bashate + +for the web: +- [biomejs/pre-commit]: a fast formatter / fixer written in rust +- [standard/standard]: linter / fixer +- [shssoichiro/oxipng]: optimize png files + +[biomejs/pre-commit]: https://github.com/biomejs/pre-commit +[standard/standard]: https://github.com/standard/standard +[shssoichiro/oxipng]: https://github.com/shssoichiro/oxipng + +for configuration files: +- [python-jsonschema/check-jsonschema]: check many common configurations with jsonschema +- [rhysd/actionlint]: lint your GitHub Actions workflow files +- [google/yamlfmt]: a formatter for yaml files +- [adrienverge/yamllint]: a linter for YAML files + +[python-jsonschema/check-jsonschema]: https://github.com/python-jsonschema/check-jsonschema +[rhysd/actionlint]: https://github.com/rhysd/actionlint +[google/yamlfmt]: https://github.com/google/yamlfmt +[adrienverge/yamllint]: https://github.com/adrienverge/yamllint + +for text / docs / prose: +- [crate-ci/typos]: find and fix common typographical errors +- [thlorenz/doctoc]: generate a table-of-contents in markdown files +- [amperser/proselint]: A linter for prose. +- [markdownlint/markdownlint]: a Markdown lint tool +- [codespell-project/codespell]: check code for common misspellings + +[crate-ci/typos]: https://github.com/crate-ci/typos +[thlorenz/doctoc]: https://github.com/thlorenz/doctoc +[amperser/proselint]: https://github.com/amperser/proselint +[markdownlint/markdownlint]: https://github.com/markdownlint/markdownlint +[codespell-project/codespell]: https://github.com/codespell-project/codespell + +for linting commit messages: +- [jorisroovers/gitlint] +- [commitizen-tools/commitizen] + +[jorisroovers/gitlint]: https://github.com/jorisroovers/gitlint +[commitizen-tools/commitizen]: https://github.com/commitizen-tools/commitizen + +for secret scanning / security: +- [gitleaks/gitleaks] +- [trufflesecurity/truffleHog] +- [thoughtworks/talisman] + +[gitleaks/gitleaks]: https://github.com/gitleaks/gitleaks +[trufflesecurity/truffleHog]: https://github.com/trufflesecurity/truffleHog +[thoughtworks/talisman]: https://github.com/thoughtworks/talisman + +for other programming languages: +- [realm/SwiftLint]: enforce Swift style and conventions +- [nicklockwood/SwiftFormat]: a formatter for Swift +- [AleksaC/terraform-py]: format and validate terraform syntax +- [rubocop/rubocop]: static analysis and formatting for Ruby +- [bufbuild/buf]: tooling for Protocol Buffers +- [sqlfluff/sqlfluff]: a modular linter and auto formatter for SQL +- [aws-cloudformation/cfn-lint]: aws CloudFormation linter +- [google/go-jsonnet]: linter / formatter for jsonnet +- [JohnnyMorganz/StyLua]: an opinionated Lua code formatter +- [Koihik/LuaFormatter]: a formatter for Lua code +- [mrtazz/checkmake]: linter for Makefile syntax + +[realm/SwiftLint]: https://github.com/realm/SwiftLint +[nicklockwood/SwiftFormat]: https://github.com/nicklockwood/SwiftFormat +[AleksaC/terraform-py]: https://github.com/AleksaC/terraform-py +[rubocop/rubocop]: https://github.com/rubocop/rubocop +[bufbuild/buf]: https://github.com/bufbuild/buf +[sqlfluff/sqlfluff]: https://github.com/sqlfluff/sqlfluff +[aws-cloudformation/cfn-lint]: https://github.com/aws-cloudformation/cfn-lint +[google/go-jsonnet]: https://github.com/google/go-jsonnet +[JohnnyMorganz/StyLua]: https://github.com/JohnnyMorganz/StyLua +[Koihik/LuaFormatter]: https://github.com/Koihik/LuaFormatter +[mrtazz/checkmake]: https://github.com/mrtazz/checkmake + +## finding hooks + +it's recommended to use your favorite searching tool to find existing hooks to +use in your project. + +for example, here's some searches you may find useful using [sourcegraph]: + +- hooks which run on python files: [`file:^\.pre-commit-hooks\.yaml$ "types: [python]"`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml%24+%22types:+[python]%22) +- hooks which run on shell files: [`file:^\.pre-commit-hooks\.yaml$ "types: [shell]"`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml%24+"types:+[shell]") +- pre-commit configurations in popular projects: [`file:^\.pre-commit-config\.yaml$`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml%24+"types:+[shell]") + +[sourcegraph]: https://sourcegraph.com/search + +you may also find [github's search] useful as well, though its querying and +sorting capabilities are quite limited plus it requires a login: + +- repositories providing hooks: [`path:.pre-commit-hooks.yaml language:YAML`](https://github.com/search?q=path%3A.pre-commit-hooks.yaml+language%3AYAML&type=code&l=YAML) + +[github's search]: https://github.com/search + + +## adding to this page + +the previous iteration of this page was a laundry list of hooks and maintaining +quality of the listed tools was cumbersome. + +**this page is not intended to be exhaustive** + +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 operate on files + +[a pull request]: https://github.com/pre-commit/pre-commit.com/blob/main/sections/hooks.md diff --git a/template_lib.py b/template_lib.py index 376f196a..05a26c61 100644 --- a/template_lib.py +++ b/template_lib.py @@ -153,7 +153,7 @@ def block_code(self, code: str, info: str | None = None) -> str: return ret -def md(s: str) -> str: +def md(s: str) -> markupsafe.Markup: html = markdown_code_blocks.highlight(s, Renderer=Renderer) # manually bless the highlighted output. return markupsafe.Markup(html) From 2cda0a7bd732922c74e4a4a7da4b1ecd5821ef22 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 21:49:09 +0000 Subject: [PATCH 407/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/hhatto/autopep8: v2.3.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.3.0...v2.3.1) - [github.com/biomejs/pre-commit: v0.3.0 → v0.4.0](https://github.com/biomejs/pre-commit/compare/v0.3.0...v0.4.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e96b26a..c3f6e2be 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/hhatto/autopep8 - rev: v2.3.0 + rev: v2.3.1 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 @@ -38,7 +38,7 @@ repos: - id: mypy additional_dependencies: [types-all] - repo: https://github.com/biomejs/pre-commit - rev: v0.3.0 + rev: v0.4.0 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 71c50e745bdaa10d59837c4274b1603107beb6cf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 23:34:22 +0000 Subject: [PATCH 408/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.10.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.0...v1.10.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c3f6e2be..eb0d0de6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.0 + rev: v1.10.1 hooks: - id: mypy additional_dependencies: [types-all] From 4d721865e7b9a2ea3c0c2a52e7e4f87bdfaf0148 Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Mon, 24 Jun 2024 15:20:51 +0200 Subject: [PATCH 409/490] Document that additional_dependencies is supported for python --- sections/new-hooks.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sections/new-hooks.md b/sections/new-hooks.md index 4fc886a5..5d8c50e3 100644 --- a/sections/new-hooks.md +++ b/sections/new-hooks.md @@ -384,6 +384,10 @@ The hook repository must be installable via `pip install .` (usually by either executable that will match the [`entry`](#hooks-entry) – usually through `console_scripts` or `scripts` in setup.py. +This language also supports `additional_dependencies` +so it can be used with [local](#repository-local-hooks) hooks. +The specified dependencies will be appended to the `pip install` command. + __Support:__ python hooks work without any system-level dependencies. It has been tested on linux, macOS, windows, and cygwin. From 75a9857021d09338beaac4cd30a4d7f56dfc6d2d Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Mon, 24 Jun 2024 12:00:59 +0200 Subject: [PATCH 410/490] repo mapping: link to docs on special "local" repo --- sections/advanced.md | 2 +- sections/plugins.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sections/advanced.md b/sections/advanced.md index 65d30ac5..cc272103 100644 --- a/sections/advanced.md +++ b/sections/advanced.md @@ -299,7 +299,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` / `fail` / `pygrep` / `script` / `system`. +or [`docker_image`](#docker_image) / [`fail`](#fail) / [`pygrep`](#pygrep) / [`script`](#script) / [`system`](#system). This enables you to install things which previously would require a trivial mirror repository. diff --git a/sections/plugins.md b/sections/plugins.md index f1e660e4..663d7f67 100644 --- a/sections/plugins.md +++ b/sections/plugins.md @@ -73,6 +73,9 @@ from. =r= =c= [`repo`](_#repos-repo) =c= the repository url to `git clone` from + or one of the special sentinel values: + [`local`](#repository-local-hooks), + [`meta`](#meta-hooks). =r= =c= [`rev`](_#repos-rev) =c= the revision or tag to clone at. From 1a59073f5994f4c833a049b20e584317f2737b06 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 22:04:27 +0000 Subject: [PATCH 411/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.10.1...v1.11.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eb0d0de6..a36123b4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.1 + rev: v1.11.0 hooks: - id: mypy additional_dependencies: [types-all] From 465a0b46f18b1936afee14b3402e252001f3c227 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 21:59:04 +0000 Subject: [PATCH 412/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.16.0 → v3.17.0](https://github.com/asottile/pyupgrade/compare/v3.16.0...v3.17.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a36123b4..fb1732ed 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.16.0 + rev: v3.17.0 hooks: - id: pyupgrade args: [--py38-plus] From d295bf3cd42f156f7758f7112bd0ba6104beeb28 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 22:39:42 +0000 Subject: [PATCH 413/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 7.1.0 → 7.1.1](https://github.com/PyCQA/flake8/compare/7.1.0...7.1.1) - [github.com/pre-commit/mirrors-mypy: v1.11.0 → v1.11.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.0...v1.11.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb1732ed..c2d55a4c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,11 +29,11 @@ repos: hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 7.1.0 + rev: 7.1.1 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.0 + rev: v1.11.1 hooks: - id: mypy additional_dependencies: [types-all] From 2faa55d0b0767799972a91b6906977bb9173e751 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 22:18:45 +0000 Subject: [PATCH 414/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.11.1 → v1.11.2](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.1...v1.11.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c2d55a4c..91a61552 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.1 + rev: v1.11.2 hooks: - id: mypy additional_dependencies: [types-all] From f0e0da0a6d8942202a29b3a0f8de0a8711ffd091 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 26 Aug 2024 19:21:34 -0400 Subject: [PATCH 415/490] remove types-all --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91a61552..aab66aec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,6 @@ repos: rev: v1.11.2 hooks: - id: mypy - additional_dependencies: [types-all] - repo: https://github.com/biomejs/pre-commit rev: v0.4.0 hooks: From 4d2ecfc6f6177c9d8d145374f0261fea1d10232f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:13:39 +0000 Subject: [PATCH 416/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v0.4.0 → v0.5.0](https://github.com/biomejs/pre-commit/compare/v0.4.0...v0.5.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aab66aec..3c5d56f4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v0.4.0 + rev: v0.5.0 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 34921bf31eaed96783e83310da2f8d9a67eab5a9 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 5 Oct 2024 15:04:05 -0400 Subject: [PATCH 417/490] update docs for pre-commit 4.0 - remove `python_venv` - remove 2.x references --- sections/advanced.md | 12 ++---------- sections/cli.md | 9 +++------ sections/new-hooks.md | 42 +++++++----------------------------------- sections/plugins.md | 3 --- 4 files changed, 12 insertions(+), 54 deletions(-) diff --git a/sections/advanced.md b/sections/advanced.md index cc272103..6d1f1f65 100644 --- a/sections/advanced.md +++ b/sections/advanced.md @@ -101,8 +101,6 @@ aborted if there is a nonzero exit code. ### post-checkout -_new in 2.2.0_ - [git post-checkout docs](https://git-scm.com/docs/githooks#_post_checkout) post-checkout hooks run *after* a `checkout` has occurred and can be used to @@ -118,8 +116,6 @@ environment variables: ### post-commit -_new in 2.4.0_ - [git post-commit docs](https://git-scm.com/docs/githooks#_post_commit) `post-commit` runs after the commit has already succeeded so it cannot be used @@ -130,8 +126,6 @@ to prevent the commit from happening. ### post-merge -_new in 2.11.0_ - [git post-merge docs](https://git-scm.com/docs/githooks#_post_merge) `post-merge` runs after a successful `git merge`. @@ -144,8 +138,6 @@ environment variables: ### post-rewrite -_new in 2.15.0_ - [git post-rewrite docs](https://git-scm.com/docs/githooks#_post_rewrite) `post-rewrite` runs after a git command which modifies history such as @@ -463,7 +455,7 @@ If a file extension you use is not supported, please `types`, `types_or`, and `files` are evaluated together with `AND` when filtering. Tags within `types` are also evaluated using `AND`. -_new in 2.9.0_: Tags within `types_or` are evaluated using `OR`. +Tags within `types_or` are evaluated using `OR`. For example: @@ -555,7 +547,7 @@ Valid values for specific languages are listed below: windows. - node: See [nodeenv](https://github.com/ekalinin/nodeenv#advanced). - ruby: See [ruby-build](https://github.com/sstephenson/ruby-build/tree/master/share/ruby-build). -- _new in 2.21.0_ rust: `language_version` is passed to `rustup` +- rust: `language_version` is passed to `rustup` - _new in 3.0.0_ golang: use the versions on [go.dev/dl](https://go.dev/dl/) such as `1.19.5` you can set [`default_language_version`](#top_level-default_language_version) diff --git a/sections/cli.md b/sections/cli.md index 0529ae5c..a644a0ae 100644 --- a/sections/cli.md +++ b/sections/cli.md @@ -6,7 +6,7 @@ All pre-commit commands take the following options: - `-c CONFIG`, `--config CONFIG`: path to alternate config file - `-h`, `--help`: show help and available options. -_new in 2.8.0_: `pre-commit` now exits with more specific codes: +`pre-commit` exits with specific codes: - `1`: a detected / expected error - `3`: an unexpected error - `130`: the process was interrupted by `^C` @@ -68,8 +68,7 @@ $ grep rev: .pre-commit-config.yaml rev: 34a269fd7650d264e4de7603157c10d0a9bb8211 # frozen: v1.25.2 ``` -_new in 2.18.0_: pre-commit will preferentially pick tags containing a `.` if -there are ties. +pre-commit will preferentially pick tags containing a `.` if there are ties. ## pre-commit clean [options] #pre-commit-clean @@ -143,7 +142,7 @@ Some example useful invocations: existing git hook scripts with pre-commit, and also installs hook environments. -_new in 2.18.0_: `pre-commit install` will now install hooks from +`pre-commit install` will install hooks from [`default_install_hook_types`](#top_level-default_install_hook_types) if `--hook-type` is not specified on the command line. @@ -178,8 +177,6 @@ Options: - `--files [FILES [FILES ...]]`: specific filenames to run hooks on. - `--from-ref FROM_REF` + `--to-ref TO_REF`: run against the files changed between `FROM_REF...TO_REF` in git. - - _new in 2.2.0_: prior to 2.2.0 the arguments were `--source` and - `--origin`. - `--hook-stage STAGE`: select a [`stage` to run](#confining-hooks-to-run-at-certain-stages). - `--show-diff-on-failure`: when hooks fail, run `git diff` directly afterward. - `-v`, `--verbose`: produce hook output independent of success. Include hook diff --git a/sections/new-hooks.md b/sections/new-hooks.md index 5d8c50e3..a1f5604e 100644 --- a/sections/new-hooks.md +++ b/sections/new-hooks.md @@ -37,7 +37,6 @@ file that tells pre-commit: =c= [`types_or`](_#hooks-types_or) =c= (optional: default `[]`) list of file types to run on (OR). See [Filtering files with types](#filtering-files-with-types). - _new in 2.9.0_. =r= =c= [`exclude_types`](_#hooks-exclude_types) =c= (optional: default `[]`) the pattern of files to exclude. @@ -48,7 +47,7 @@ file that tells pre-commit: =r= =c= [`fail_fast`](_#hooks-fail_fast) =c= (optional: default `false`) if `true` pre-commit will stop running - hooks if this hook fails. _new in 2.16.0_. + hooks if this hook fails. =r= =c= [`verbose`](_#hooks-verbose) =c= (optional: default `false`) if `true`, forces the output of the hook to be printed even when @@ -151,7 +150,6 @@ Hello from foo hook! - [node](#node) - [perl](#perl) - [python](#python) -- [python_venv](#python_venv) - [r](#r) - [ruby](#ruby) - [rust](#rust) @@ -169,7 +167,7 @@ The `conda` language also supports [`additional_dependencies`](#config-additiona and will pass any of the values directly into `conda install`. This language can therefore be used with [local](#repository-local-hooks) hooks. -_new in 2.17.0_: `mamba` or `micromamba` can be used to install instead via the +`mamba` or `micromamba` can be used to install instead via the `PRE_COMMIT_USE_MAMBA=1` or `PRE_COMMIT_USE_MICROMAMBA=1` environment variables. @@ -179,8 +177,6 @@ It has been tested on linux, macOS, and windows. ### coursier -_new in 2.8.0_ - The hook repository must have a `.pre-commit-channel` folder and that folder must contain the coursier [application descriptors](https://get-coursier.io/docs/2.0.0-RC6-10/cli-install.html#application-descriptor-reference) @@ -193,16 +189,14 @@ __Support:__ `coursier` hooks are known to work on any system which has the applications you install may depend on various versions of the JVM, consult the hooks' documentation for clarification. It has been tested on linux. -_new in 2.18.0_: pre-commit now supports the `coursier` naming of the package -manager executable. +pre-commit also supports the `coursier` naming of the package manager +executable. _new in 3.0.0_: `language: coursier` hooks now support `repo: local` and `additional_dependencies`. ### dart -_new in 2.15.0_ - The hook repository must have a `pubspec.yaml` -- this must contain an `executables` section which will list the binaries that will be available after installation. Match the [`entry`](#hooks-entry) to an executable. @@ -274,8 +268,6 @@ For example: ### dotnet -_new in 2.8.0_ - dotnet hooks are installed using the system installation of the dotnet CLI. Hook repositories must contain a dotnet CLI tool which can be `pack`ed and @@ -340,8 +332,6 @@ installed. It has been tested on linux, macOS, and windows. ### lua -_new in 2.17.0_ - Lua hooks are installed with the version of Lua that is used by Luarocks. __Support:__ Lua hooks are known to work on any system which has Luarocks @@ -358,8 +348,6 @@ been tested on linux, windows, and macOS and _may_ work under cygwin. ### perl -_new in 2.1.0_ - Perl hooks are installed using the system installation of [cpan](https://perldoc.perl.org/cpan), the CPAN package installer that comes with Perl. @@ -391,24 +379,8 @@ The specified dependencies will be appended to the `pip install` command. __Support:__ python hooks work without any system-level dependencies. It has been tested on linux, macOS, windows, and cygwin. -### python_venv - -_new in 2.4.0_: The `python_venv` language is now an alias to `python` since -`virtualenv>=20` creates equivalently structured environments. Previously, -this [`language`](#hooks-language) created environments using the [venv] module. - -This [`language`](#hooks-language) will be removed eventually so it is suggested to use `python` -instead. - -[venv]: https://docs.python.org/3/library/venv.html - -__Support:__ python hooks work without any system-level dependencies. It -has been tested on linux, macOS, windows, and cygwin. - ### r -_new in 2.11.0_ - This hook repository must have a `renv.lock` file that will be restored with [`renv::restore()`](https://rstudio.github.io/renv/reference/restore.html) on hook installation. If the repository is an R package (i.e. has `Type: Package` @@ -452,8 +424,8 @@ build _your_ hook repo), or the special syntax `cli:{package_name}:{package_version}` for a CLI dependency (built separately, with binaries made available for use by hooks). -_new in 2.21.0_: pre-commit will bootstrap `rust` if it is not present. -`language: rust` also now supports `language_version` +pre-commit will bootstrap `rust` if it is not present. +`language: rust` also supports `language_version` __Support:__ It has been tested on linux, Windows, and macOS. @@ -476,7 +448,7 @@ can apply the `(?i)` flag as the start of your entry, or use `args: [-i]`. For multiline matches, use `args: [--multiline]`. -_new in 2.8.0_: To require all files to match, use `args: [--negate]`. +To require all files to match, use `args: [--negate]`. __Support:__ pygrep hooks are supported on all platforms which pre-commit runs on. diff --git a/sections/plugins.md b/sections/plugins.md index 663d7f67..96cb213c 100644 --- a/sections/plugins.md +++ b/sections/plugins.md @@ -15,8 +15,6 @@ pre-commit config file describes what repositories and hooks are installed. =c= (optional: default `[pre-commit]`) a list of `--hook-type`s which will be used by default when running [`pre-commit install`](#pre-commit-install). - - _new in 2.18.0_ =r= =c= [`default_language_version`](_#top_level-default_language_version) =c= (optional: default `{}`) a mapping from language to the default @@ -129,7 +127,6 @@ repository's configuration. =c= [`types_or`](_#config-types_or) =c= (optional) override the default file types to run on (OR). See [Filtering files with types](#filtering-files-with-types). - _new in 2.9.0_. =r= =c= [`exclude_types`](_#config-exclude_types) =c= (optional) file types to exclude. From 778f687b0a376cd5aaf8b41c2369befeac1193ad Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 00:02:12 +0000 Subject: [PATCH 418/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c5d56f4..9742afe7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer From d5992ed02c06471733f5789e625e675b3a304f63 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 11 Oct 2024 20:04:21 -0400 Subject: [PATCH 419/490] py39+ Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9742afe7..96958bad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: rev: v3.13.0 hooks: - id: reorder-python-imports - args: [--py38-plus, --add-import, 'from __future__ import annotations'] + args: [--py39-plus, --add-import, 'from __future__ import annotations'] - id: reorder-python-imports - repo: https://github.com/asottile/add-trailing-comma rev: v3.1.0 @@ -23,7 +23,7 @@ repos: rev: v3.17.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/hhatto/autopep8 rev: v2.3.1 hooks: From de8fe47915b11d8138ec2374a7c525d10c7df47a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:30:27 +0000 Subject: [PATCH 420/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder-python-imports: v3.13.0 → v3.14.0](https://github.com/asottile/reorder-python-imports/compare/v3.13.0...v3.14.0) - [github.com/asottile/pyupgrade: v3.17.0 → v3.18.0](https://github.com/asottile/pyupgrade/compare/v3.17.0...v3.18.0) - [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.12.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.2...v1.12.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 96958bad..d1eb6846 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/reorder-python-imports - rev: v3.13.0 + rev: v3.14.0 hooks: - id: reorder-python-imports args: [--py39-plus, --add-import, 'from __future__ import annotations'] @@ -20,7 +20,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 + rev: v3.18.0 hooks: - id: pyupgrade args: [--py39-plus] @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 + rev: v1.12.1 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit From 3846ccffecd3371f54c978ccc5cecdb75282cacb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 22:57:00 +0000 Subject: [PATCH 421/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.18.0 → v3.19.0](https://github.com/asottile/pyupgrade/compare/v3.18.0...v3.19.0) - [github.com/pre-commit/mirrors-mypy: v1.12.1 → v1.13.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.12.1...v1.13.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d1eb6846..f95b7cdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.18.0 + rev: v3.19.0 hooks: - id: pyupgrade args: [--py39-plus] @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.12.1 + rev: v1.13.0 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit From 2f511142d22f7bb58b0d762cab654fdfda01f6b5 Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli Date: Wed, 20 Nov 2024 11:50:53 +0000 Subject: [PATCH 422/490] Add nbqa to list of hooks --- sections/hooks.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sections/hooks.md b/sections/hooks.md index 703bb5d3..828e9db9 100644 --- a/sections/hooks.md +++ b/sections/hooks.md @@ -112,6 +112,7 @@ for other programming languages: - [JohnnyMorganz/StyLua]: an opinionated Lua code formatter - [Koihik/LuaFormatter]: a formatter for Lua code - [mrtazz/checkmake]: linter for Makefile syntax +- [nbqa-dev/nbqa]: run common linters on Jupyter Notebooks [realm/SwiftLint]: https://github.com/realm/SwiftLint [nicklockwood/SwiftFormat]: https://github.com/nicklockwood/SwiftFormat @@ -124,6 +125,7 @@ for other programming languages: [JohnnyMorganz/StyLua]: https://github.com/JohnnyMorganz/StyLua [Koihik/LuaFormatter]: https://github.com/Koihik/LuaFormatter [mrtazz/checkmake]: https://github.com/mrtazz/checkmake +[nbqa-dev/nbqa]: https://github.com/nbQA-dev/nbQA ## finding hooks From f8eda3bb32b700e6927d3553cda7e9b2ca2153f3 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 1 Nov 2024 15:36:18 +0100 Subject: [PATCH 423/490] Documentation for julia hooks See pre-commit PR: https://github.com/pre-commit/pre-commit/pull/3348 --- sections/new-hooks.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/sections/new-hooks.md b/sections/new-hooks.md index a1f5604e..70699666 100644 --- a/sections/new-hooks.md +++ b/sections/new-hooks.md @@ -330,6 +330,45 @@ This language supports `additional_dependencies` so it can be used as a __Support:__ haskell hooks are known to work on any system which has `cabal` installed. It has been tested on linux, macOS, and windows. +### julia + +_new in 4.1.0_ + +For configuring julia hooks, your [`entry`](#hooks-entry) should be a path to a julia source +file relative to the hook repository (optionally with arguments). + +Hooks run in an isolated package environment defined by a `Project.toml` file (optionally +with a `Manifest.toml` file) in the hook repository. If no `Project.toml` file is found the +hook is run in an empty environment. + +Julia hooks support [`additional_dependencies`](#config-additional_dependencies) which can +be used to augment, or override, the existing environment in the hooks repository. This also +means that julia can be used as a `repo: local` hook. `additional_dependencies` are passed +to `pkg> add` and should be specified using +[Pkg REPL mode syntax](https://pkgdocs.julialang.org/v1/repl/#repl-add). + +Examples: + +```yaml +- id: foo-without-args + name: ... + language: julia + entry: bin/foo.jl +- id: bar-with-args + name: ... + language: julia + entry: bin/bar.jl --arg1 --arg2 +- id: baz-with-extra-deps + name: ... + language: julia + entry: bin/baz.jl + additional_dependencies: + - 'ExtraDepA@1' + - 'ExtraDepB@2.4' +``` + +__Support:__ julia hooks are known to work on any system which has `julia` installed. + ### lua Lua hooks are installed with the version of Lua that is used by Luarocks. From 5da39af30602984cfd50034e071843ec4f11910d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:35:03 +0000 Subject: [PATCH 424/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v0.5.0 → v0.6.0](https://github.com/biomejs/pre-commit/compare/v0.5.0...v0.6.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f95b7cdf..7aac2d2a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v0.5.0 + rev: v0.6.0 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 8ac3aaea32eeec8361075369918a3e45cb92d699 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 16 Dec 2024 20:48:07 -0500 Subject: [PATCH 425/490] undo language_version: lts --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7aac2d2a..bd57334e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,3 +41,5 @@ repos: hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] + # https://github.com/biomejs/pre-commit/issues/16 + language_version: default From c9b579ca70f167fc5107c743bf9a20bc98f3eaa1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 22:45:31 +0000 Subject: [PATCH 426/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.19.0 → v3.19.1](https://github.com/asottile/pyupgrade/compare/v3.19.0...v3.19.1) - [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.13.0...v1.14.0) - [github.com/biomejs/pre-commit: v0.6.0 → v0.6.1](https://github.com/biomejs/pre-commit/compare/v0.6.0...v0.6.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd57334e..966a5a18 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.19.0 + rev: v3.19.1 hooks: - id: pyupgrade args: [--py39-plus] @@ -33,11 +33,11 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.0 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v0.6.0 + rev: v0.6.1 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 7cbbecab199c4abfe8eda1eaf0398677f82fbc26 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 23 Dec 2024 21:15:26 -0500 Subject: [PATCH 427/490] remove `language_version` workaround --- .pre-commit-config.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 966a5a18..fa22c789 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,5 +41,3 @@ repos: hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] - # https://github.com/biomejs/pre-commit/issues/16 - language_version: default From 4b53cb42cd8c0d22ef4204080e93031c8ddcb12e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 23:30:25 +0000 Subject: [PATCH 428/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.14.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.14.0...v1.14.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa22c789..7380f6b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.14.0 + rev: v1.14.1 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit From 75e7d099e5559d6d89e2afffce34970e951c6cdd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 22:29:50 +0000 Subject: [PATCH 429/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/hhatto/autopep8: v2.3.1 → v2.3.2](https://github.com/hhatto/autopep8/compare/v2.3.1...v2.3.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7380f6b8..1ef5586f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: pyupgrade args: [--py39-plus] - repo: https://github.com/hhatto/autopep8 - rev: v2.3.1 + rev: v2.3.2 hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 From f2412b98716212cf3a53c1c27e2bd7a8d0a13ee6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 22:44:03 +0000 Subject: [PATCH 430/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.14.1 → v1.15.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.14.1...v1.15.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ef5586f..c9640e61 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.14.1 + rev: v1.15.0 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit From 5f40d02e70c202dbfc5d73c2516af728e26c7fec Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 21:07:34 +0000 Subject: [PATCH 431/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 7.1.1 → 7.1.2](https://github.com/PyCQA/flake8/compare/7.1.1...7.1.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c9640e61..6153149e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 7.1.1 + rev: 7.1.2 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy From d4fe6de0f4c7fdaf0024b144e439b6ca98916726 Mon Sep 17 00:00:00 2001 From: David Xia Date: Fri, 7 Feb 2025 08:00:34 -0500 Subject: [PATCH 432/490] docs: add DavidAnson/markdownlint-cli2 to hooks page The current Markdownlint hook is in Ruby. Mention a popular Node-based one as well. Signed-off-by: David Xia --- sections/hooks.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sections/hooks.md b/sections/hooks.md index 828e9db9..8796a4da 100644 --- a/sections/hooks.md +++ b/sections/hooks.md @@ -75,13 +75,15 @@ for text / docs / prose: - [crate-ci/typos]: find and fix common typographical errors - [thlorenz/doctoc]: generate a table-of-contents in markdown files - [amperser/proselint]: A linter for prose. -- [markdownlint/markdownlint]: a Markdown lint tool +- [markdownlint/markdownlint]: a Markdown lint tool in Ruby +- [DavidAnson/markdownlint-cli2]: a Markdown lint tool in Node - [codespell-project/codespell]: check code for common misspellings [crate-ci/typos]: https://github.com/crate-ci/typos [thlorenz/doctoc]: https://github.com/thlorenz/doctoc [amperser/proselint]: https://github.com/amperser/proselint [markdownlint/markdownlint]: https://github.com/markdownlint/markdownlint +[DavidAnson/markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2 [codespell-project/codespell]: https://github.com/codespell-project/codespell for linting commit messages: From 96caf22c7466eb215a614389a51908ca0cdac2d9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:44:47 +0000 Subject: [PATCH 433/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v0.6.1 → v1.9.4](https://github.com/biomejs/pre-commit/compare/v0.6.1...v1.9.4) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6153149e..12005c89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v0.6.1 + rev: v1.9.4 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 50954289ede630b82d3fbf128a63a433b28379ef Mon Sep 17 00:00:00 2001 From: Maksym Vlasov Date: Mon, 17 Mar 2025 14:26:36 +0200 Subject: [PATCH 434/490] docs: Fix missleading link It was copy-pasted from previous link for shell, and currently point to wrong search result. This PR fix that. --- sections/hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sections/hooks.md b/sections/hooks.md index 8796a4da..40d17c36 100644 --- a/sections/hooks.md +++ b/sections/hooks.md @@ -138,7 +138,7 @@ for example, here's some searches you may find useful using [sourcegraph]: - hooks which run on python files: [`file:^\.pre-commit-hooks\.yaml$ "types: [python]"`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml%24+%22types:+[python]%22) - hooks which run on shell files: [`file:^\.pre-commit-hooks\.yaml$ "types: [shell]"`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml%24+"types:+[shell]") -- pre-commit configurations in popular projects: [`file:^\.pre-commit-config\.yaml$`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml%24+"types:+[shell]") +- pre-commit configurations in popular projects: [`file:^\.pre-commit-config\.yaml$`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml") [sourcegraph]: https://sourcegraph.com/search From 8be946894b24903ac7e2bfc1484c8b6315259791 Mon Sep 17 00:00:00 2001 From: Maksym Vlasov Date: Fri, 21 Mar 2025 00:32:36 +0200 Subject: [PATCH 435/490] docs: Fix broken link --- sections/hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sections/hooks.md b/sections/hooks.md index 40d17c36..1a97d5dc 100644 --- a/sections/hooks.md +++ b/sections/hooks.md @@ -138,7 +138,7 @@ for example, here's some searches you may find useful using [sourcegraph]: - hooks which run on python files: [`file:^\.pre-commit-hooks\.yaml$ "types: [python]"`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml%24+%22types:+[python]%22) - hooks which run on shell files: [`file:^\.pre-commit-hooks\.yaml$ "types: [shell]"`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml%24+"types:+[shell]") -- pre-commit configurations in popular projects: [`file:^\.pre-commit-config\.yaml$`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml") +- pre-commit configurations in popular projects: [`file:^\.pre-commit-config\.yaml$`](https://sourcegraph.com/search?q=context:global+file:^\.pre-commit-hooks\.yaml) [sourcegraph]: https://sourcegraph.com/search From 7cd4f25b1cea23ef0a33bfff040e55e339611807 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 19:43:56 +0000 Subject: [PATCH 436/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 7.1.2 → 7.2.0](https://github.com/PyCQA/flake8/compare/7.1.2...7.2.0) - [github.com/biomejs/pre-commit: v1.9.4 → v2.0.0-beta.1](https://github.com/biomejs/pre-commit/compare/v1.9.4...v2.0.0-beta.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12005c89..7fa55780 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 7.1.2 + rev: 7.2.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v1.9.4 + rev: v2.0.0-beta.1 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 113d1134cdbc5089e8ecfc60c1135cd16371de93 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 19:56:04 +0000 Subject: [PATCH 437/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.0.0-beta.1 → v2.0.0-beta.2](https://github.com/biomejs/pre-commit/compare/v2.0.0-beta.1...v2.0.0-beta.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7fa55780..8c0297c5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.0.0-beta.1 + rev: v2.0.0-beta.2 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From c526c9ad16b5d3c8b8e21f9ac2cf5613fab1d522 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 19:43:22 +0000 Subject: [PATCH 438/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.0.0-beta.2 → v2.0.0-beta.3](https://github.com/biomejs/pre-commit/compare/v2.0.0-beta.2...v2.0.0-beta.3) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8c0297c5..a6feae51 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.0.0-beta.2 + rev: v2.0.0-beta.3 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 6749eb002979f118b725d9a7c31bc62f7a367514 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 19:47:46 +0000 Subject: [PATCH 439/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.0.0-beta.3 → v2.0.0-beta.4](https://github.com/biomejs/pre-commit/compare/v2.0.0-beta.3...v2.0.0-beta.4) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a6feae51..8f75b88e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.0.0-beta.3 + rev: v2.0.0-beta.4 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 788d0a616db94946945792759d1ca70c3072d7cf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 19:45:49 +0000 Subject: [PATCH 440/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder-python-imports: v3.14.0 → v3.15.0](https://github.com/asottile/reorder-python-imports/compare/v3.14.0...v3.15.0) - [github.com/asottile/add-trailing-comma: v3.1.0 → v3.2.0](https://github.com/asottile/add-trailing-comma/compare/v3.1.0...v3.2.0) - [github.com/asottile/pyupgrade: v3.19.1 → v3.20.0](https://github.com/asottile/pyupgrade/compare/v3.19.1...v3.20.0) - [github.com/biomejs/pre-commit: v2.0.0-beta.4 → v2.0.0-beta.5](https://github.com/biomejs/pre-commit/compare/v2.0.0-beta.4...v2.0.0-beta.5) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f75b88e..49b7d7de 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,17 +10,17 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/reorder-python-imports - rev: v3.14.0 + rev: v3.15.0 hooks: - id: reorder-python-imports args: [--py39-plus, --add-import, 'from __future__ import annotations'] - id: reorder-python-imports - repo: https://github.com/asottile/add-trailing-comma - rev: v3.1.0 + rev: v3.2.0 hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.19.1 + rev: v3.20.0 hooks: - id: pyupgrade args: [--py39-plus] @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.0.0-beta.4 + rev: v2.0.0-beta.5 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 4152f35c884b779c41dc98fefcd00854476b950a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 19:57:11 +0000 Subject: [PATCH 441/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.15.0 → v1.16.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.15.0...v1.16.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 49b7d7de..65df650e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.15.0 + rev: v1.16.0 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit From afe5d18e313b76e288440e0542bf2ea67ba712c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 19:55:26 +0000 Subject: [PATCH 442/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/flake8: 7.2.0 → 7.3.0](https://github.com/PyCQA/flake8/compare/7.2.0...7.3.0) - [github.com/pre-commit/mirrors-mypy: v1.16.0 → v1.16.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.16.0...v1.16.1) - [github.com/biomejs/pre-commit: v2.0.0-beta.5 → v2.0.2](https://github.com/biomejs/pre-commit/compare/v2.0.0-beta.5...v2.0.2) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 65df650e..8f123d07 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,15 +29,15 @@ repos: hooks: - id: autopep8 - repo: https://github.com/PyCQA/flake8 - rev: 7.2.0 + rev: 7.3.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.16.0 + rev: v1.16.1 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.0.0-beta.5 + rev: v2.0.2 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 505020bf91edf43eef1f5efa70c7e40181ca081a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 19:40:10 +0000 Subject: [PATCH 443/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.0.2 → v2.0.6](https://github.com/biomejs/pre-commit/compare/v2.0.2...v2.0.6) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f123d07..60c3474c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.0.2 + rev: v2.0.6 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 0e1a4fb3d0a2b0665bfc5bae24c97dd48afdc29f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 20:02:26 +0000 Subject: [PATCH 444/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.16.1 → v1.17.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.16.1...v1.17.0) - [github.com/biomejs/pre-commit: v2.0.6 → v2.1.2](https://github.com/biomejs/pre-commit/compare/v2.0.6...v2.1.2) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 60c3474c..565bbce4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,11 +33,11 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.16.1 + rev: v1.17.0 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.0.6 + rev: v2.1.2 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 8e6c0cf9125c64b6918365c67abb8f1a3028d2d3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 20:31:37 +0000 Subject: [PATCH 445/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.17.0 → v1.17.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.17.0...v1.17.1) - [github.com/biomejs/pre-commit: v2.1.2 → v2.1.3](https://github.com/biomejs/pre-commit/compare/v2.1.2...v2.1.3) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 565bbce4..06118d83 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,11 +33,11 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.17.0 + rev: v1.17.1 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.1.2 + rev: v2.1.3 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 262eef89d2ce2cc0ec8e023f9088768735ec04d3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:46:41 +0000 Subject: [PATCH 446/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/biomejs/pre-commit: v2.1.3 → v2.1.4](https://github.com/biomejs/pre-commit/compare/v2.1.3...v2.1.4) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 06118d83..9f306963 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.1.3 + rev: v2.1.4 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 30335c6efa212c75b1d93903eac5609e7bf8bb90 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 20:20:02 +0000 Subject: [PATCH 447/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.1.4 → v2.2.0](https://github.com/biomejs/pre-commit/compare/v2.1.4...v2.2.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f306963..2a4833b2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.1.4 + rev: v2.2.0 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 4a2da412c9cdda77ca028a2c25af45ce6c56b6ce Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:10:14 +0000 Subject: [PATCH 448/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.2.0 → v2.2.2](https://github.com/biomejs/pre-commit/compare/v2.2.0...v2.2.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a4833b2..973105dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.2.0 + rev: v2.2.2 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 060c74ed5c8cceb802702ab311b246c47d87e16b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 20:24:27 +0000 Subject: [PATCH 449/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.2.2 → v2.2.3](https://github.com/biomejs/pre-commit/compare/v2.2.2...v2.2.3) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 973105dd..0586c7dc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.2.2 + rev: v2.2.3 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From e46b5072a3d271b9e48fc0810822adb87ade8145 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 20:23:56 +0000 Subject: [PATCH 450/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.17.1 → v1.18.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.17.1...v1.18.1) - [github.com/biomejs/pre-commit: v2.2.3 → v2.2.4](https://github.com/biomejs/pre-commit/compare/v2.2.3...v2.2.4) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0586c7dc..ad802039 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,11 +33,11 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.17.1 + rev: v1.18.1 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.2.3 + rev: v2.2.4 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 7e560abc624ac15cafe945791e6f8b1c241bd20c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 20:44:17 +0000 Subject: [PATCH 451/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.18.1 → v1.18.2](https://github.com/pre-commit/mirrors-mypy/compare/v1.18.1...v1.18.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ad802039..eabcd2e5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.18.1 + rev: v1.18.2 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit From 9bdfa1943323464659d48ad8a91c98dff5c6389f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:25:46 +0000 Subject: [PATCH 452/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.2.4 → v2.2.5](https://github.com/biomejs/pre-commit/compare/v2.2.4...v2.2.5) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eabcd2e5..b7ff4eca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.2.4 + rev: v2.2.5 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From c03eb70f65896db17317e5f089d43135cd7f5c78 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Thu, 9 Oct 2025 17:46:20 -0400 Subject: [PATCH 453/490] py310+ Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eabcd2e5..9b4299ad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: rev: v3.15.0 hooks: - id: reorder-python-imports - args: [--py39-plus, --add-import, 'from __future__ import annotations'] + args: [--py310-plus, --add-import, 'from __future__ import annotations'] - id: reorder-python-imports - repo: https://github.com/asottile/add-trailing-comma rev: v3.2.0 @@ -23,7 +23,7 @@ repos: rev: v3.20.0 hooks: - id: pyupgrade - args: [--py39-plus] + args: [--py310-plus] - repo: https://github.com/hhatto/autopep8 rev: v2.3.2 hooks: From 5fc98faf8148dadeaf2a95f7b31baea9b15b83fe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 20:38:51 +0000 Subject: [PATCH 454/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder-python-imports: v3.15.0 → v3.16.0](https://github.com/asottile/reorder-python-imports/compare/v3.15.0...v3.16.0) - [github.com/asottile/add-trailing-comma: v3.2.0 → v4.0.0](https://github.com/asottile/add-trailing-comma/compare/v3.2.0...v4.0.0) - [github.com/asottile/pyupgrade: v3.20.0 → v3.21.0](https://github.com/asottile/pyupgrade/compare/v3.20.0...v3.21.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62fffc4a..d8267d73 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,17 +10,17 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - repo: https://github.com/asottile/reorder-python-imports - rev: v3.15.0 + rev: v3.16.0 hooks: - id: reorder-python-imports args: [--py310-plus, --add-import, 'from __future__ import annotations'] - id: reorder-python-imports - repo: https://github.com/asottile/add-trailing-comma - rev: v3.2.0 + rev: v4.0.0 hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.20.0 + rev: v3.21.0 hooks: - id: pyupgrade args: [--py310-plus] From a6b97bafeb862011669fd9b18cea5bb61fb88ed7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 22:31:21 +0000 Subject: [PATCH 455/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.2.5 → v2.2.6](https://github.com/biomejs/pre-commit/compare/v2.2.5...v2.2.6) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d8267d73..18774736 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.2.5 + rev: v2.2.6 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From cf1df5734a9cfdec66613686914d5ffa58da1a92 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 20:19:51 +0000 Subject: [PATCH 456/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.2.6 → v2.3.1](https://github.com/biomejs/pre-commit/compare/v2.2.6...v2.3.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 18774736..04f322cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.2.6 + rev: v2.3.1 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 0e8ffd5dc2b19b3c62048ea513e84acc337f67a1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 20:45:48 +0000 Subject: [PATCH 457/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.3.1 → v2.3.2](https://github.com/biomejs/pre-commit/compare/v2.3.1...v2.3.2) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 04f322cf..cc9c126b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.3.1 + rev: v2.3.2 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From ed4f60b5f538399b765988882eb0cdb61e5df851 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Sat, 8 Nov 2025 17:11:18 -0500 Subject: [PATCH 458/490] 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. From de92afe062779e768d861af8ca5ce22734997295 Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Sun, 9 Nov 2025 00:16:32 +0200 Subject: [PATCH 459/490] Update new-hooks.md to fix anchor link --- sections/new-hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sections/new-hooks.md b/sections/new-hooks.md index 7f35b991..6154b821 100644 --- a/sections/new-hooks.md +++ b/sections/new-hooks.md @@ -156,7 +156,7 @@ Hello from foo hook! - [swift](#swift) - [pygrep](#pygrep) - [unsupported](#unsupported) -- [unsupported_script](#unsupported_scripts) +- [unsupported_script](#unsupported_script) ### conda From 287dea84064fa7bb98796eb9d430ca4f005ff090 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 21:00:01 +0000 Subject: [PATCH 460/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.21.0 → v3.21.1](https://github.com/asottile/pyupgrade/compare/v3.21.0...v3.21.1) - [github.com/biomejs/pre-commit: v2.3.2 → v2.3.4](https://github.com/biomejs/pre-commit/compare/v2.3.2...v2.3.4) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cc9c126b..f0cb09b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.21.0 + rev: v3.21.1 hooks: - id: pyupgrade args: [--py310-plus] @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.3.2 + rev: v2.3.4 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 2aef9432e3a2bcd4eee6f5be4bb2434a53cbf5a2 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Mon, 17 Nov 2025 13:06:37 -0500 Subject: [PATCH 461/490] update link to oxipng --- sections/hooks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sections/hooks.md b/sections/hooks.md index 27dc128c..a045f6f6 100644 --- a/sections/hooks.md +++ b/sections/hooks.md @@ -54,11 +54,11 @@ for shell scripts: for the web: - [biomejs/pre-commit]: a fast formatter / fixer written in rust - [standard/standard]: linter / fixer -- [shssoichiro/oxipng]: optimize png files +- [oxipng/oxipng]: optimize png files [biomejs/pre-commit]: https://github.com/biomejs/pre-commit [standard/standard]: https://github.com/standard/standard -[shssoichiro/oxipng]: https://github.com/shssoichiro/oxipng +[oxipng/oxipng]: https://github.com/oxipng/oxipng for configuration files: - [python-jsonschema/check-jsonschema]: check many common configurations with jsonschema From f90e3d7364c92fc9299a52c5916a91e99640994c Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Mon, 17 Nov 2025 13:08:12 -0500 Subject: [PATCH 462/490] remove all-repos.yaml removed references over a year ago in 53aacc6daa654bd0038ad662245286357ac96571 --- all-repos.yaml | 249 ------------------------------------------------- 1 file changed, 249 deletions(-) delete mode 100644 all-repos.yaml diff --git a/all-repos.yaml b/all-repos.yaml deleted file mode 100644 index 90eecf56..00000000 --- a/all-repos.yaml +++ /dev/null @@ -1,249 +0,0 @@ -# This file is used to generate all-hooks.json -- https://github.com/pre-commit/pre-commit-hooks -- https://github.com/pre-commit/mirrors-clang-format -- https://github.com/pre-commit/mirrors-csslint -- https://github.com/pre-commit/mirrors-eslint -- https://github.com/pre-commit/mirrors-fixmyjs -- https://github.com/pre-commit/mirrors-jshint -- https://github.com/pre-commit/mirrors-mypy -- https://github.com/pre-commit/mirrors-puppet-lint -- https://github.com/pre-commit/mirrors-scss-lint -- https://github.com/pre-commit/mirrors-yapf -- https://github.com/pre-commit/pygrep-hooks -- https://github.com/pre-commit/sync-pre-commit-deps -- https://github.com/FalconSocial/pre-commit-mirrors-pep257 -- https://github.com/FalconSocial/pre-commit-python-sorter -- https://github.com/MarketSquare/robotframework-tidy -- https://github.com/guykisel/prospector-mirror -- https://github.com/asottile/add-trailing-comma -- https://github.com/asottile/pyupgrade -- https://github.com/asottile/reorder-python-imports -- https://github.com/asottile/yesqa -- https://github.com/asottile/dead -- https://github.com/asottile/setup-cfg-fmt -- https://github.com/asottile/cheetah_lint -- https://github.com/digitalpulp/pre-commit-php -- https://github.com/elidupuis/mirrors-jscs -- https://github.com/elidupuis/mirrors-sass-lint -# - https://github.com/jumanjihouse/pre-commit-hooks -- https://github.com/jumanjihouse/pre-commit-hook-yamlfmt -- https://github.com/Lucas-C/pre-commit-hooks -# - https://github.com/Lucas-C/pre-commit-hooks-java -- https://github.com/Lucas-C/pre-commit-hooks-lxml -# - https://github.com/Lucas-C/pre-commit-hooks-markup -# - https://github.com/Lucas-C/pre-commit-hooks-nodejs -- https://github.com/Lucas-C/pre-commit-hooks-safety -- https://github.com/chriskuehl/puppet-pre-commit-hooks -- https://github.com/golangci/golangci-lint -- https://github.com/Bahjat/pre-commit-golang -- https://github.com/dnephin/pre-commit-golang -- https://github.com/troian/pre-commit-golang -- https://github.com/jstewmon/check-swagger -- https://github.com/detailyang/pre-commit-shell -- https://github.com/lovesegfault/beautysh -- https://github.com/antonbabenko/pre-commit-terraform -- https://github.com/ansible-community/ansible-lint -- https://github.com/doublify/pre-commit-clang-format -- https://github.com/doublify/pre-commit-go -- https://github.com/doublify/pre-commit-hindent -- https://github.com/doublify/pre-commit-rust -- https://github.com/awebdeveloper/pre-commit-stylelint -- https://github.com/awebdeveloper/pre-commit-tslint -- https://github.com/adrienverge/yamllint -- https://github.com/thlorenz/doctoc -- https://github.com/noahsark769/xcodeproj-sort-pre-commit-hook -- https://github.com/jorisroovers/gitlint -- https://github.com/psf/black -- https://github.com/IamTheFij/ansible-pre-commit -- https://github.com/IamTheFij/docker-pre-commit -- https://github.com/mattlqx/pre-commit-ruby -- https://github.com/mattlqx/pre-commit-sign -- https://github.com/mattlqx/pre-commit-search-and-replace -- https://github.com/pryorda/dockerfilelint-precommit-hooks -- https://github.com/alessandrojcm/commitlint-pre-commit-hook -- https://github.com/henryykt/pre-commit-perl -- https://github.com/juancarlospaco/pre-commit-nim -- https://github.com/aws-cloudformation/cfn-lint -- https://github.com/thoughtworks/talisman -- https://github.com/PyCQA/flake8 -- https://github.com/PyCQA/bandit -- https://github.com/PyCQA/pydocstyle -- https://github.com/PyCQA/pylint -- https://github.com/PyCQA/doc8 -- https://github.com/PyCQA/prospector -- https://github.com/PyCQA/isort -- https://github.com/PyCQA/docformatter -- https://github.com/PyCQA/autoflake -- https://github.com/miki725/importanize -- https://github.com/motet-a/jinjalint -- https://github.com/milin/giticket -- https://github.com/milin/gitown -- https://github.com/sqlalchemyorg/zimports -- https://github.com/peterdemin/pip-compile-multi -- https://github.com/homebysix/pre-commit-macadmin -- https://github.com/fortman/pre-commit-prometheus -- https://github.com/syntaqx/git-hooks -- https://github.com/lunarmodules/luacheck -- https://github.com/Koihik/LuaFormatter -- https://github.com/Calinou/pre-commit-luacheck -- https://github.com/belminf/pre-commit-chef -- https://github.com/pocc/pre-commit-hooks -- https://github.com/dwightgunning/pre-commit-nglint -- https://github.com/codespell-project/codespell -- https://gitlab.com/smop/pre-commit-hooks -- https://github.com/seddonym/import-linter -- https://github.com/marco-c/taskcluster_yml_validator -- https://github.com/rstcheck/rstcheck -- https://github.com/lorenzwalthert/precommit -- https://github.com/lorenzwalthert/gitignore-tidy -- https://github.com/FelixSeptem/pre-commit-golang -- https://gitlab.com/daverona/pre-commit/cpp -- https://github.com/codingjoe/relint -- https://github.com/nix-community/nixpkgs-fmt -- https://github.com/d6e/beancount-check -- https://gitlab.com/iamlikeme/nbhooks -- https://github.com/Vimjas/vint -- https://github.com/eschulte/lisp-format -- https://github.com/shellcheck-py/shellcheck-py -- https://github.com/APIDevTools/swagger-cli -- https://github.com/kynan/nbstripout -- https://gitlab.com/devopshq/gitlab-ci-linter -- https://github.com/bmorcos/pre-commit-hooks-cpp -- https://github.com/igorshubovych/markdownlint-cli -- https://github.com/TekWizely/pre-commit-golang -- https://github.com/markdownlint/markdownlint -- https://github.com/jguttman94/pre-commit-gradle -- https://github.com/Yelp/detect-secrets -- https://github.com/dmitri-lerko/pre-commit-docker-kustomize -- https://github.com/perltidy/perltidy -- https://github.com/talos-systems/conform -- https://github.com/twu/skjold -- https://github.com/commitizen-tools/commitizen -- https://github.com/gherynos/pre-commit-java -- https://github.com/lietu/go-pre-commit -- https://github.com/macisamuele/language-formatters-pre-commit-hooks -- https://github.com/jlebar/pre-commit-hooks -- https://github.com/jazzband/pip-tools -- https://github.com/pappasam/toml-sort -- https://github.com/arenadotio/pre-commit-ocamlformat -- https://github.com/hcodes/yaspeller -- https://github.com/maltzj/google-style-precommit-hook -- https://github.com/jvstein/pre-commit-dotnet-format -- https://github.com/PeterMosmans/jenkinslint -- https://github.com/nicklockwood/SwiftFormat -- https://github.com/executablebooks/mdformat -- https://gitlab.com/daverona/pre-commit/php -- https://github.com/anderseknert/pre-commit-opa -- https://github.com/radix-ai/auto-smart-commit -- https://github.com/thibaudcolas/curlylint -- https://github.com/cheshirekow/cmake-format-precommit -- https://github.com/aorumbayev/pydantic-to-schema -- https://github.com/hadialqattan/pycln -- https://github.com/nbQA-dev/nbQA -- https://github.com/Scony/godot-gdscript-toolkit -- https://github.com/avilaton/add-msg-issue-prefix-hook -- https://github.com/dustinsand/pre-commit-jvm -- https://github.com/alan-turing-institute/CleverCSV-pre-commit -- https://gitlab.com/jvenom/elixir-pre-commit-hooks -- https://github.com/Cretezy/flutter-format-pre-commit -- https://github.com/dluksza/flutter-analyze-pre-commit -- https://github.com/fluttercommunity/import_sorter -- https://github.com/editorconfig-checker/editorconfig-checker.python -- https://gitlab.com/pablodiehl/pre-commit-lua-formatter -- https://github.com/frnmst/md-toc -- https://github.com/mgedmin/check-manifest -# - https://github.com/ecugol/pre-commit-hooks-django -- https://github.com/PrincetonUniversity/blocklint -- https://github.com/python-jsonschema/check-jsonschema -- https://github.com/sirosen/texthooks -- https://github.com/snok/pep585-upgrade -- https://github.com/jendrikseipp/vulture -- https://github.com/mwouts/jupytext -- https://github.com/ejba/pre-commit-maven -- https://github.com/tfsec/tfsec -- https://github.com/yoheimuta/protolint -- https://github.com/hadolint/hadolint -- https://github.com/google/go-jsonnet -- https://github.com/google/yamlfmt -- https://github.com/guid-empty/flutter-dependency-validation-pre-commit -- https://github.com/cpplint/cpplint -- https://github.com/MarcoGorelli/absolufy-imports -- https://github.com/MarcoGorelli/auto-walrus -- https://github.com/MarcoGorelli/cython-lint -- https://github.com/domdfcoding/flake2lint -- https://github.com/dotnet/format -- https://github.com/ashwin153/pre-commit-vagrant -- https://github.com/AleksaC/hadolint-py -- https://github.com/AleksaC/circleci-cli-py -- https://github.com/AleksaC/mirrors-cfn-nag -- https://github.com/cmake-lint/cmake-lint -- https://github.com/priv-kweihmann/oelint-adv -- https://github.com/jggomez/pre-commit-android-kotlin -- https://github.com/Carreau/velin -- https://github.com/chrismgrayftsinc/jsonnetfmt -- https://github.com/zricethezav/gitleaks -- https://github.com/hugoh/pre-commit-fish -# - https://github.com/nbyl/pre-commit-license-checks -# - https://github.com/jonasbb/pre-commit-latex-hooks -- https://github.com/dfm/black_nbconvert -- https://github.com/crate-ci/typos -- https://github.com/snakemake/snakefmt -- https://github.com/regebro/pyroma -- https://github.com/tox-dev/tox-ini-fmt -- https://github.com/janosh/format-ipy-cells -- https://github.com/FalcoSuessgott/lint-gitlab-ci -- https://github.com/comkieffer/xml-linter-hook -- https://github.com/jackdewinter/pymarkdown -- https://github.com/klieret/jekyll-relative-url-check -- https://github.com/tarioch/flux-check-hook -- https://github.com/streetsidesoftware/cspell-cli -- https://github.com/rapidsai/frigate -- https://github.com/norwoodj/helm-docs -- https://github.com/sqlfluff/sqlfluff -- https://github.com/adamchainz/blacken-docs -- https://github.com/adamchainz/django-upgrade -- https://github.com/scop/pre-commit-shfmt -- https://github.com/scop/pre-commit-perlcritic -- https://github.com/BlankSpruce/gersemi -- https://github.com/realm/SwiftLint -- https://gitlab.com/bmares/check-json5 -- https://github.com/semaphor-dk/dansabel -- https://github.com/gitguardian/gg-shield -- https://github.com/JohnnyMorganz/StyLua -- https://github.com/shssoichiro/oxipng -- https://github.com/datarootsio/databooks -- https://github.com/standard/standard -- https://github.com/Sceptre/sceptrelint -- https://github.com/lyz-code/yamlfix -- https://github.com/dannysepler/rm_unneeded_f_str -- https://github.com/cmhughes/latexindent.pl -- https://github.com/sirwart/ripsecrets -- https://github.com/bagerard/graphviz-dot-hooks -- https://github.com/omnilib/ufmt -- https://github.com/daveshanley/vacuum -- https://github.com/nuztalgia/botstrap -- https://gitlab.com/adam-moss/pre-commit-trailer -- https://gitlab.com/adam-moss/pre-commit-ssh-git-signing-key -- https://github.com/astral-sh/ruff-pre-commit -- https://github.com/mrtazz/checkmake -- https://github.com/jshwi/docsig -- https://github.com/finsberg/clang-format-docs -- https://github.com/rubocop/rubocop -- https://github.com/dbt-checkpoint/dbt-checkpoint -- https://gitlab.com/engmark/vcard -- https://github.com/Data-Liberation-Front/csvlint.rb -- https://github.com/christopher-hacker/enforce-notebook-run-order -- https://github.com/mxr/unkey -- https://github.com/Mateusz-Grzelinski/actionlint-py -- https://github.com/andrewring/github-distributed-owners -- https://github.com/Mermeid-Designs/pydantic-hooks -- https://github.com/igrr/astyle_py -- https://gitlab.com/codementors/pre-commit/add-issue-number-to-conventional-commit -- https://github.com/numpy/numpydoc -- https://github.com/hakancelikdev/unimport -- https://github.com/hakancelikdev/unexport -- https://github.com/KindDragon/gn-build-py -- https://github.com/stefmolin/exif-stripper -- https://github.com/hhatto/autopep8 -- https://github.com/rhysd/actionlint -- https://github.com/hija/clean-dotenv From f8f9c9315572bb7e40b18c26bd7bf44295d09f25 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 20:30:37 +0000 Subject: [PATCH 463/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.3.4 → v2.3.5](https://github.com/biomejs/pre-commit/compare/v2.3.4...v2.3.5) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f0cb09b8..07211466 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.3.4 + rev: v2.3.5 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From f35f043f5e64adf8f8e5c996f4c0508b13d85f86 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Sat, 22 Nov 2025 16:48:14 -0500 Subject: [PATCH 464/490] document `pre-commit hazmat` --- sections/advanced.md | 93 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/sections/advanced.md b/sections/advanced.md index b5f7f227..442dbff1 100644 --- a/sections/advanced.md +++ b/sections/advanced.md @@ -352,6 +352,99 @@ The currently available `meta` hooks: debugging. ``` +## `pre-commit hazmat` + +"hazardous materials" + +pre-commit provides a few `entry` prefix "helpers" for unusual situations. + +in case it's not clear, using these is _usually_ a bad idea. + +_note_: hazmat helpers do not work on languages which adjust `entry` (`docker` +/ `docker_image` / `fail` / `julia` / `pygrep` / `r` / `unsupported_script`). + +### `pre-commit hazmat cd` + +_new in 4.5.0_ + +for "monorepo" usage one can use this to target a subdirectory. + +this entry prefix will cd to the target subdir and adjust filename arguments + +example usage: + +```yaml +# recommended: +# minimum_pre_commit_version: 4.5.0 +repos: +- repo: ... + rev: ... + hooks: + - id: example + alias: example-repo1 + name: example (repo1) + files: ^repo1/ + # important! ends with `--` + # important! copy `args: [...]` to entry and blank out `args: []` + entry: pre-commit hazmat cd repo1 example-bin --arg1 -- + args: [] + + - id: example + alias: example-repo2 + name: example (repo2) + files: ^repo2/ + entry: pre-commit hazmat cd repo2 example-bin --arg1 -- + args: [] + + # ... etc. +``` + +### `pre-commit hazmat ignore-exit-code` + +_new in 4.5.0_ + +it's a bad idea to introduce warning noise but this gives you a way to do it. + +example: + +```yaml +# recommended: +# minimum_pre_commit_version: 4.5.0 +repos: +- repo: ... + rev: ... + hooks: + - id: example + # important! copy `args: [...]` to entry and blank out `args: []` + entry: pre-commit hazmat ignore-exit-code example-bin --arg1 -- + args: [] + # otherwise the output will always be hidden + verbose: true +``` + +### `pre-commit hazmat n1` + +_new in 4.5.0_ + +some hooks only take one filename argument. this runs them one at a time +(which is super slow!) + +example: + +```yaml +# recommended: +# minimum_pre_commit_version: 4.5.0 +repos: +- repo: ... + rev: ... + hooks: + - id: example + # important! ends with `--` + # important! copy `args: [...]` to entry and blank out `args: []` + entry: pre-commit hazmat n1 example-bin --arg1 -- + args: [] +``` + ## automatically enabling pre-commit on repositories `pre-commit init-templatedir` can be used to set up a skeleton for `git`'s From d09459c1fbdd6fd7b8509f0a501cd63c8c9ed356 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:53:51 +0000 Subject: [PATCH 465/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.21.1 → v3.21.2](https://github.com/asottile/pyupgrade/compare/v3.21.1...v3.21.2) - [github.com/biomejs/pre-commit: v2.3.5 → v2.3.7](https://github.com/biomejs/pre-commit/compare/v2.3.5...v2.3.7) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 07211466..a6474e83 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v3.21.1 + rev: v3.21.2 hooks: - id: pyupgrade args: [--py310-plus] @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.3.5 + rev: v2.3.7 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 6740110ea1c43d84c6cea09d45ab87d7137ff48c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 21:05:21 +0000 Subject: [PATCH 466/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.18.2 → v1.19.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.18.2...v1.19.0) - [github.com/biomejs/pre-commit: v2.3.7 → v2.3.8](https://github.com/biomejs/pre-commit/compare/v2.3.7...v2.3.8) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a6474e83..113669b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,11 +33,11 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.18.2 + rev: v1.19.0 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.3.7 + rev: v2.3.8 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 92414a56f02690b8a895332b5c7bde18087b7967 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:49:03 +0000 Subject: [PATCH 467/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.19.0 → v1.19.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.19.0...v1.19.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 113669b1..088e0d95 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.19.0 + rev: v1.19.1 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit From 47556e078482b9500d75acb2670e8cee87b49ea2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 20:26:31 +0000 Subject: [PATCH 468/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.3.8 → v2.3.10](https://github.com/biomejs/pre-commit/compare/v2.3.8...v2.3.10) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 088e0d95..84487e17 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.3.8 + rev: v2.3.10 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 392108ef916d5c87836a842f41f4c31b364d2448 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Sat, 3 Jan 2026 08:00:42 -0500 Subject: [PATCH 469/490] Add julia to supported languages in new-hooks.md --- sections/new-hooks.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sections/new-hooks.md b/sections/new-hooks.md index 6154b821..587ccfd5 100644 --- a/sections/new-hooks.md +++ b/sections/new-hooks.md @@ -146,6 +146,7 @@ Hello from foo hook! - [fail](#fail) - [golang](#golang) - [haskell](#haskell) +- [julia](#julia) - [lua](#lua) - [node](#node) - [perl](#perl) From b587ec453054ee5c8949019783f9a7c21dcd4a7a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 30 Jan 2026 14:44:41 -0500 Subject: [PATCH 470/490] document validate-config / validate-manifest --- sections/cli.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sections/cli.md b/sections/cli.md index a644a0ae..56b74d76 100644 --- a/sections/cli.md +++ b/sections/cli.md @@ -233,3 +233,11 @@ Uninstall the pre-commit script. Options: - `-t HOOK_TYPE, --hook-type HOOK_TYPE`: which hook type to uninstall. + +## pre-commit validate-config [options] [filenames ...] #pre-commit-validate-config + +Validate .pre-commit-config.yaml files + +## pre-commit validate-manifest [options] [filenames ...] #pre-commit-validate-manifest + +Validate .pre-commit-hooks.yaml files From a4aafb147834fe1af11d6b4764f7c9ed98440974 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 21:49:04 +0000 Subject: [PATCH 471/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.3.10 → v2.3.14](https://github.com/biomejs/pre-commit/compare/v2.3.10...v2.3.14) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 84487e17..387a3ac4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.3.10 + rev: v2.3.14 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 106554d73c04a35d8517a9d67efeb955c225e66a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 20:28:58 +0000 Subject: [PATCH 472/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.3.14 → v2.3.15](https://github.com/biomejs/pre-commit/compare/v2.3.14...v2.3.15) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 387a3ac4..fb5e9799 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.3.14 + rev: v2.3.15 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 931459f771fdc6e5e7a1606fc07cbce5d195d2d6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 20:56:37 +0000 Subject: [PATCH 473/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.3.15 → v2.4.4](https://github.com/biomejs/pre-commit/compare/v2.3.15...v2.4.4) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb5e9799..3069f855 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.3.15 + rev: v2.4.4 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From ccd7e31d699538dcaec7078594412588457ef572 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 21:09:12 +0000 Subject: [PATCH 474/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.4.4 → v2.4.6](https://github.com/biomejs/pre-commit/compare/v2.4.4...v2.4.6) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3069f855..1c32b889 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.4 + rev: v2.4.6 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From d1294c3ef7d41512cd89088eaa7d8c7b8951ac21 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 21:03:18 +0000 Subject: [PATCH 475/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.4.6 → v2.4.7](https://github.com/biomejs/pre-commit/compare/v2.4.6...v2.4.7) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c32b889..93069c8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.6 + rev: v2.4.7 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From a284af67b082a1f8d60fba10506a980e6ea3914d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 20:36:28 +0000 Subject: [PATCH 476/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.4.7 → v2.4.8](https://github.com/biomejs/pre-commit/compare/v2.4.7...v2.4.8) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 93069c8c..a9c89401 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.7 + rev: v2.4.8 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From ce931e1cd46262fd5099ba95b7325e7adbc732ff Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 20:36:34 +0000 Subject: [PATCH 477/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.4.8 → v2.4.9](https://github.com/biomejs/pre-commit/compare/v2.4.8...v2.4.9) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9c89401..d9af6322 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.8 + rev: v2.4.9 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From ef83ef1d8cda38ab346e3674c4f6b824139067c7 Mon Sep 17 00:00:00 2001 From: Matthew Hughes Date: Thu, 26 Mar 2026 20:48:48 +0000 Subject: [PATCH 478/490] Document `PRE_COMMIT` environment variable Document this variable, exposed since `v2.5.0`[1], as a way to determine if `pre-commit` is running. Because It took a bit of searching in the `pre-commit` repo to discover the existence of this variable. Link: https://github.com/pre-commit/pre-commit/commit/2f25085d60bf953fea457a3240c91886145dbcc5 [1] --- sections/new-hooks.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sections/new-hooks.md b/sections/new-hooks.md index 587ccfd5..7f21d439 100644 --- a/sections/new-hooks.md +++ b/sections/new-hooks.md @@ -4,6 +4,9 @@ installable package (gem, npm, pypi, etc.) or exposes an executable, it can be used with pre-commit. Each git repo can support as many languages/hooks as you want. +_new in 2.5.0_: `pre-commit` sets the `PRE_COMMIT=1` environment variable +during hook execution. + The hook must exit nonzero on failure or modify files. A git repo containing pre-commit plugins must contain a `.pre-commit-hooks.yaml` From 6a6a0a195871b9fd8368086d3094ea62814d5b82 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 21:10:15 +0000 Subject: [PATCH 479/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.19.1 → v1.20.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.19.1...v1.20.0) - [github.com/biomejs/pre-commit: v2.4.9 → v2.4.10](https://github.com/biomejs/pre-commit/compare/v2.4.9...v2.4.10) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9af6322..c94d0e68 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,11 +33,11 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.19.1 + rev: v1.20.0 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.9 + rev: v2.4.10 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From d82a43cfe3aa29a4d8644d059931086acd9fbd69 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 20:41:26 +0000 Subject: [PATCH 480/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.20.0 → v1.20.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.20.0...v1.20.1) - [github.com/biomejs/pre-commit: v2.4.10 → v2.4.11](https://github.com/biomejs/pre-commit/compare/v2.4.10...v2.4.11) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c94d0e68..715ec127 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,11 +33,11 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.20.0 + rev: v1.20.1 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.10 + rev: v2.4.11 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 301d2b619a8d446a0164a097a16c2f6370ea949b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 20:26:11 +0000 Subject: [PATCH 481/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.4.11 → v2.4.12](https://github.com/biomejs/pre-commit/compare/v2.4.11...v2.4.12) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 715ec127..110c92ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.11 + rev: v2.4.12 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 756f7abd18d28c207e5c6f6d276c8ef87efc0d70 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Tue, 21 Apr 2026 17:11:08 -0400 Subject: [PATCH 482/490] document support for git 2.54+ hooks --- sections/advanced.md | 71 ++++++++++++++++++++++++++++++++++++++++++++ template_lib.py | 2 +- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/sections/advanced.md b/sections/advanced.md index 442dbff1..e7531157 100644 --- a/sections/advanced.md +++ b/sections/advanced.md @@ -445,8 +445,79 @@ repos: args: [] ``` +## usage with git 2.54+ hook configuration + +_new in 4.6.0_: pre-commit improved support for `git config`-based hooks. +a later version will change `pre-commit install` to use this approach. + +[git 2.54] introduced a new way to install git hook tools via `git config`. + +the basic gist is the following enables a hook in a git repo: + +```bash +git config set hook..event pre-push +git config set hook..command 'some command here' +``` + +an example setup with `pre-commit` might look like: + +```bash +# note, the "hook" name here is `pre-commit.pre-commit` +# for the `pre-commit` "tool" and the `pre-commit` "event" +git config set hook.pre-commit.pre-commit.event pre-commit +git config set hook.pre-commit.pre-commit.command 'pre-commit hook-impl --hook-type pre-commit --' + +# please follow that naming scheme for future compatibility with `pre-commit install` + +# an example with pre-push: +# +# git config set hook.pre-commit.pre-push.event pre-push +# git config set hook.pre-commit.pre-push.command 'pre-commit hook-impl --hook-type pre-push --' +``` + +`pre-commit hook-impl` is a "hidden" implementation command with these options: +- `--hook-type ...`: the [hook type](#supported-git-hooks) to use +- `--skip-on-missing-config`: silently pass when a config is missing + +some interesting applications of this: + +### "global" installation of pre-commit + +with `git config set --global ...` this can automatically enable pre-commit +for all repositories: + +```bash +git config set --global hook.pre-commit.pre-commit.event pre-commit +git config set --global hook.pre-commit.pre-commit.command 'pre-commit hook-impl --hook-type pre-commit --skip-on-missing-config --' +``` + +- this setup **not recommended** as it can lead to accidentally running hooks + when interacting with an untrusted repository. +- `--skip-on-missing-config` is recommended here as arbitrary git repositories + may not have a `.pre-commit-config.yaml`. + +### always running a hook on all files + +since you can configure pre-commit as many times as you want you *could* invoke +pre-commit to run a particular hook always and on all files + +```bash +git config set hook.pre-commit.pre-commit-always.event pre-commit +git config set hook.pre-commit.pre-commit-always.command 'pre-commit run hookid --hook-stage pre-commit --all-files' +``` + +*note*: this is not recommended as it has the tendancy to be slow and deviates +from the normal expectations of pre-commit. + +[git 2.54]: https://github.blog/open-source/git/highlights-from-git-2-54/#h-config-based-hooks + ## automatically enabling pre-commit on repositories +*note*: if you are on a new-enough version of `git` you may want to use +[this approach](#global-installation-of-pre-commit) instead. + +___ + `pre-commit init-templatedir` can be used to set up a skeleton for `git`'s `init.templateDir` option. This means that any newly cloned repository will automatically have the hooks set up without the need to run diff --git a/template_lib.py b/template_lib.py index 05a26c61..72286d70 100644 --- a/template_lib.py +++ b/template_lib.py @@ -12,7 +12,7 @@ ID_RE = re.compile(r' #([a-z0-9-]+)$') -SPECIAL_CHARS_RE = re.compile('[^a-z0-9 _-]') +SPECIAL_CHARS_RE = re.compile('(&[a-z]+;|[^a-z0-9 _-])') ROW = '=r=' From 54cd70dfa20378d2c656f1b764e02966587629ad Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Wed, 22 Apr 2026 09:32:44 -0400 Subject: [PATCH 483/490] also document --config for hook-impl --- sections/advanced.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sections/advanced.md b/sections/advanced.md index e7531157..646f2ac1 100644 --- a/sections/advanced.md +++ b/sections/advanced.md @@ -477,6 +477,7 @@ git config set hook.pre-commit.pre-commit.command 'pre-commit hook-impl --hook-t `pre-commit hook-impl` is a "hidden" implementation command with these options: - `--hook-type ...`: the [hook type](#supported-git-hooks) to use +- `--config ...`: (optional) path to `.pre-commit-config.yaml` - `--skip-on-missing-config`: silently pass when a config is missing some interesting applications of this: From dfcca29ccab42fe6f0561b12932d4b8ace60cf32 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 21:08:43 +0000 Subject: [PATCH 484/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.20.1 → v1.20.2](https://github.com/pre-commit/mirrors-mypy/compare/v1.20.1...v1.20.2) - [github.com/biomejs/pre-commit: v2.4.12 → v2.4.13](https://github.com/biomejs/pre-commit/compare/v2.4.12...v2.4.13) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 110c92ec..30c8fc25 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,11 +33,11 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.20.1 + rev: v1.20.2 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.12 + rev: v2.4.13 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From 680799de09a2f9415eb5d22cb8f6f0a6d5f903ba Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 20:31:48 +0000 Subject: [PATCH 485/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.4.13 → v2.4.14](https://github.com/biomejs/pre-commit/compare/v2.4.13...v2.4.14) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30c8fc25..2d92b1f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.13 + rev: v2.4.14 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From f0b1c6a2207ad6f5d79351fc4f8e275755392b23 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 20:24:43 +0000 Subject: [PATCH 486/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.20.2 → v2.0.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.20.2...v2.0.0) - [github.com/biomejs/pre-commit: v2.4.14 → v2.4.15](https://github.com/biomejs/pre-commit/compare/v2.4.14...v2.4.15) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2d92b1f3..f387ba22 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,11 +33,11 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.20.2 + rev: v2.0.0 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.14 + rev: v2.4.15 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@1.8.1"] From b73acadb5076665198f4adba5fe5a6dff73a5876 Mon Sep 17 00:00:00 2001 From: Max R Date: Mon, 18 May 2026 14:49:29 -0400 Subject: [PATCH 487/490] Remove redundant Biome pre-commit additional dependencies and update biome.json Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 1 - biome.json | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f387ba22..29d3782a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,4 +40,3 @@ repos: rev: v2.4.15 hooks: - id: biome-check - additional_dependencies: ["@biomejs/biome@1.8.1"] diff --git a/biome.json b/biome.json index 03e2df98..e99b718f 100644 --- a/biome.json +++ b/biome.json @@ -1,7 +1,11 @@ { - "$schema": "https://biomejs.dev/schemas/1.4.0/schema.json", - "organizeImports": { - "enabled": false + "$schema": "https://biomejs.dev/schemas/2.4.15/schema.json", + "assist": { + "actions": { + "source": { + "organizeImports": "off" + } + } }, "formatter": { "indentStyle": "space", From 6b4b9a1f7420768662d652507f72af727178c22a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 21:13:41 +0000 Subject: [PATCH 488/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v2.0.0 → v2.1.0](https://github.com/pre-commit/mirrors-mypy/compare/v2.0.0...v2.1.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29d3782a..79c2fe2f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v2.0.0 + rev: v2.1.0 hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit From 6af0665b1e586d58be0daeea8e2aaaf5b6510cd9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 21:27:25 +0000 Subject: [PATCH 489/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.4.15 → v2.4.16](https://github.com/biomejs/pre-commit/compare/v2.4.15...v2.4.16) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 79c2fe2f..885239ae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,6 +37,6 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.15 + rev: v2.4.16 hooks: - id: biome-check From c4ac9996467da7979c67c4deab15631a530d5e67 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2026 20:47:05 +0000 Subject: [PATCH 490/490] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/biomejs/pre-commit: v2.4.16 → v2.5.0](https://github.com/biomejs/pre-commit/compare/v2.4.16...v2.5.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 885239ae..1f2f8c10 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,6 +37,6 @@ repos: hooks: - id: mypy - repo: https://github.com/biomejs/pre-commit - rev: v2.4.16 + rev: v2.5.0 hooks: - id: biome-check