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.
-
+
Tweet
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
==============
-[](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=64&branchName=master)
+[](https://results.pre-commit.ci/latest/github/pre-commit/pre-commit.com/master)
[](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 @@