Skip to content

Commit 34921bf

Browse files
committed
update docs for pre-commit 4.0
- remove `python_venv` - remove 2.x references
1 parent b25a3c2 commit 34921bf

File tree

4 files changed

+12
-54
lines changed

4 files changed

+12
-54
lines changed

sections/advanced.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ aborted if there is a nonzero exit code.
101101

102102
### post-checkout
103103

104-
_new in 2.2.0_
105-
106104
[git post-checkout docs](https://git-scm.com/docs/githooks#_post_checkout)
107105

108106
post-checkout hooks run *after* a `checkout` has occurred and can be used to
@@ -118,8 +116,6 @@ environment variables:
118116

119117
### post-commit
120118

121-
_new in 2.4.0_
122-
123119
[git post-commit docs](https://git-scm.com/docs/githooks#_post_commit)
124120

125121
`post-commit` runs after the commit has already succeeded so it cannot be used
@@ -130,8 +126,6 @@ to prevent the commit from happening.
130126

131127
### post-merge
132128

133-
_new in 2.11.0_
134-
135129
[git post-merge docs](https://git-scm.com/docs/githooks#_post_merge)
136130

137131
`post-merge` runs after a successful `git merge`.
@@ -144,8 +138,6 @@ environment variables:
144138

145139
### post-rewrite
146140

147-
_new in 2.15.0_
148-
149141
[git post-rewrite docs](https://git-scm.com/docs/githooks#_post_rewrite)
150142

151143
`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
463455
`types`, `types_or`, and `files` are evaluated together with `AND` when
464456
filtering. Tags within `types` are also evaluated using `AND`.
465457

466-
_new in 2.9.0_: Tags within `types_or` are evaluated using `OR`.
458+
Tags within `types_or` are evaluated using `OR`.
467459

468460
For example:
469461

@@ -555,7 +547,7 @@ Valid values for specific languages are listed below:
555547
windows.
556548
- node: See [nodeenv](https://github.com/ekalinin/nodeenv#advanced).
557549
- ruby: See [ruby-build](https://github.com/sstephenson/ruby-build/tree/master/share/ruby-build).
558-
- _new in 2.21.0_ rust: `language_version` is passed to `rustup`
550+
- rust: `language_version` is passed to `rustup`
559551
- _new in 3.0.0_ golang: use the versions on [go.dev/dl](https://go.dev/dl/) such as `1.19.5`
560552

561553
you can set [`default_language_version`](#top_level-default_language_version)

sections/cli.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ All pre-commit commands take the following options:
66
- `-c CONFIG`, `--config CONFIG`: path to alternate config file
77
- `-h`, `--help`: show help and available options.
88

9-
_new in 2.8.0_: `pre-commit` now exits with more specific codes:
9+
`pre-commit` exits with specific codes:
1010
- `1`: a detected / expected error
1111
- `3`: an unexpected error
1212
- `130`: the process was interrupted by `^C`
@@ -68,8 +68,7 @@ $ grep rev: .pre-commit-config.yaml
6868
rev: 34a269fd7650d264e4de7603157c10d0a9bb8211 # frozen: v1.25.2
6969
```
7070
71-
_new in 2.18.0_: pre-commit will preferentially pick tags containing a `.` if
72-
there are ties.
71+
pre-commit will preferentially pick tags containing a `.` if there are ties.
7372

7473
## pre-commit clean [options] #pre-commit-clean
7574

@@ -143,7 +142,7 @@ Some example useful invocations:
143142
existing git hook scripts with pre-commit, and also installs hook
144143
environments.
145144

146-
_new in 2.18.0_: `pre-commit install` will now install hooks from
145+
`pre-commit install` will install hooks from
147146
[`default_install_hook_types`](#top_level-default_install_hook_types) if
148147
`--hook-type` is not specified on the command line.
149148

@@ -178,8 +177,6 @@ Options:
178177
- `--files [FILES [FILES ...]]`: specific filenames to run hooks on.
179178
- `--from-ref FROM_REF` + `--to-ref TO_REF`: run against the files changed
180179
between `FROM_REF...TO_REF` in git.
181-
- _new in 2.2.0_: prior to 2.2.0 the arguments were `--source` and
182-
`--origin`.
183180
- `--hook-stage STAGE`: select a [`stage` to run](#confining-hooks-to-run-at-certain-stages).
184181
- `--show-diff-on-failure`: when hooks fail, run `git diff` directly afterward.
185182
- `-v`, `--verbose`: produce hook output independent of success. Include hook

sections/new-hooks.md

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ file that tells pre-commit:
3737
=c= [`types_or`](_#hooks-types_or)
3838
=c= (optional: default `[]`) list of file types to run on (OR). See
3939
[Filtering files with types](#filtering-files-with-types).
40-
_new in 2.9.0_.
4140
=r=
4241
=c= [`exclude_types`](_#hooks-exclude_types)
4342
=c= (optional: default `[]`) the pattern of files to exclude.
@@ -48,7 +47,7 @@ file that tells pre-commit:
4847
=r=
4948
=c= [`fail_fast`](_#hooks-fail_fast)
5049
=c= (optional: default `false`) if `true` pre-commit will stop running
51-
hooks if this hook fails. _new in 2.16.0_.
50+
hooks if this hook fails.
5251
=r=
5352
=c= [`verbose`](_#hooks-verbose)
5453
=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!
151150
- [node](#node)
152151
- [perl](#perl)
153152
- [python](#python)
154-
- [python_venv](#python_venv)
155153
- [r](#r)
156154
- [ruby](#ruby)
157155
- [rust](#rust)
@@ -169,7 +167,7 @@ The `conda` language also supports [`additional_dependencies`](#config-additiona
169167
and will pass any of the values directly into `conda install`. This language can therefore be
170168
used with [local](#repository-local-hooks) hooks.
171169

172-
_new in 2.17.0_: `mamba` or `micromamba` can be used to install instead via the
170+
`mamba` or `micromamba` can be used to install instead via the
173171
`PRE_COMMIT_USE_MAMBA=1` or `PRE_COMMIT_USE_MICROMAMBA=1` environment
174172
variables.
175173

@@ -179,8 +177,6 @@ It has been tested on linux, macOS, and windows.
179177

180178
### coursier
181179

182-
_new in 2.8.0_
183-
184180
The hook repository must have a `.pre-commit-channel` folder and that folder
185181
must contain the coursier
186182
[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
193189
applications you install may depend on various versions of the JVM, consult
194190
the hooks' documentation for clarification. It has been tested on linux.
195191

196-
_new in 2.18.0_: pre-commit now supports the `coursier` naming of the package
197-
manager executable.
192+
pre-commit also supports the `coursier` naming of the package manager
193+
executable.
198194

199195
_new in 3.0.0_: `language: coursier` hooks now support `repo: local` and
200196
`additional_dependencies`.
201197

202198
### dart
203199

204-
_new in 2.15.0_
205-
206200
The hook repository must have a `pubspec.yaml` -- this must contain an
207201
`executables` section which will list the binaries that will be available
208202
after installation. Match the [`entry`](#hooks-entry) to an executable.
@@ -274,8 +268,6 @@ For example:
274268

275269
### dotnet
276270

277-
_new in 2.8.0_
278-
279271
dotnet hooks are installed using the system installation of the dotnet CLI.
280272

281273
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.
340332
341333
### lua
342334
343-
_new in 2.17.0_
344-
345335
Lua hooks are installed with the version of Lua that is used by Luarocks.
346336
347337
__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.
358348
359349
### perl
360350
361-
_new in 2.1.0_
362-
363351
Perl hooks are installed using the system installation of
364352
[cpan](https://perldoc.perl.org/cpan), the CPAN package installer
365353
that comes with Perl.
@@ -391,24 +379,8 @@ The specified dependencies will be appended to the `pip install` command.
391379
__Support:__ python hooks work without any system-level dependencies. It
392380
has been tested on linux, macOS, windows, and cygwin.
393381
394-
### python_venv
395-
396-
_new in 2.4.0_: The `python_venv` language is now an alias to `python` since
397-
`virtualenv>=20` creates equivalently structured environments. Previously,
398-
this [`language`](#hooks-language) created environments using the [venv] module.
399-
400-
This [`language`](#hooks-language) will be removed eventually so it is suggested to use `python`
401-
instead.
402-
403-
[venv]: https://docs.python.org/3/library/venv.html
404-
405-
__Support:__ python hooks work without any system-level dependencies. It
406-
has been tested on linux, macOS, windows, and cygwin.
407-
408382
### r
409383
410-
_new in 2.11.0_
411-
412384
This hook repository must have a `renv.lock` file that will be restored with
413385
[`renv::restore()`](https://rstudio.github.io/renv/reference/restore.html) on
414386
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
452424
`cli:{package_name}:{package_version}` for a CLI dependency (built separately,
453425
with binaries made available for use by hooks).
454426

455-
_new in 2.21.0_: pre-commit will bootstrap `rust` if it is not present.
456-
`language: rust` also now supports `language_version`
427+
pre-commit will bootstrap `rust` if it is not present.
428+
`language: rust` also supports `language_version`
457429

458430
__Support:__ It has been tested on linux, Windows, and macOS.
459431

@@ -476,7 +448,7 @@ can apply the `(?i)` flag as the start of your entry, or use `args: [-i]`.
476448

477449
For multiline matches, use `args: [--multiline]`.
478450

479-
_new in 2.8.0_: To require all files to match, use `args: [--negate]`.
451+
To require all files to match, use `args: [--negate]`.
480452

481453
__Support:__ pygrep hooks are supported on all platforms which pre-commit runs
482454
on.

sections/plugins.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ pre-commit config file describes what repositories and hooks are installed.
1515
=c= (optional: default `[pre-commit]`) a list of `--hook-type`s which will
1616
be used by default when running
1717
[`pre-commit install`](#pre-commit-install).
18-
19-
_new in 2.18.0_
2018
=r=
2119
=c= [`default_language_version`](_#top_level-default_language_version)
2220
=c= (optional: default `{}`) a mapping from language to the default
@@ -129,7 +127,6 @@ repository's configuration.
129127
=c= [`types_or`](_#config-types_or)
130128
=c= (optional) override the default file types to run on (OR). See
131129
[Filtering files with types](#filtering-files-with-types).
132-
_new in 2.9.0_.
133130
=r=
134131
=c= [`exclude_types`](_#config-exclude_types)
135132
=c= (optional) file types to exclude.

0 commit comments

Comments
 (0)