Anthony Sottile
0afb95ccca
test docker and docker_image directly
2023-02-04 17:22:06 -05:00
Anthony Sottile
420902f67c
fix r local hooks
...
`language: r` acts more like `language: script` so we have to *not* append
the prefix when run with `repo: local`
2023-01-29 17:27:42 -05:00
Anthony Sottile
628c876b2d
adjust the run_hook api to no longer take Hook
2023-01-16 16:34:01 -05:00
Anthony Sottile
ae34a962d7
make in_env part of the language api
2023-01-16 15:36:29 -05:00
Anthony Sottile
05c8911363
simplify environment_dir
2023-01-01 21:11:56 -05:00
Anthony Sottile
d05b7888ab
move clean_path_on_failure out of each hook install
2023-01-01 20:04:58 -05:00
Anthony Sottile
07554e9525
add additional info to healthy-after-install check
2022-04-16 16:46:28 -04:00
Anthony Sottile
04de6a2e57
drop python 3.6 support
...
python 3.6 reached end of life on 2021-12-23
2022-01-18 18:44:20 -05:00
Anthony Sottile
5d1cac64c1
ignore self-container when in docker-in-docker
2021-08-03 13:08:07 -07:00
Adar Nimrod
3e1020945e
A more reliable way to get the container id.
...
The hostname is not always the container id. Get the container id from
/proc/1/cgroup. Fixes #1918 .
2021-07-03 10:43:11 -07:00
Oleg Kainov
6d5d386c9f
fix: fix path mounting when running in Docker
...
Currently pre-commit mounts the current directory to /src and uses
current directory name as mount base.
However this does not work when pre-commit is run inside the container
on some mounted path already, because mount points are relative to the
host, not to the container.
Fixes #1387
2021-04-28 19:21:34 -07:00
Anthony Sottile
3584b99caa
simplify docker run
2020-10-10 18:09:51 -07:00
Ruairidh MacLeod
eb8b48aeb4
remove docker_is_running check from source
...
Moved to testing.util so it can be used for the skipif_cant_run_docker
test hooks.
2020-08-22 17:33:32 -07:00
KYLE ZHU
23d5b78fdb
Don't use --user when running docker on windows
2020-03-19 21:55:16 -07:00
Anthony Sottile
67c1beb322
Use covdefaults to handle coveragerc
2020-02-29 14:25:19 -08:00
Anthony Sottile
fa8d022813
Remove unnecessary forward annotations
2020-02-07 08:32:39 -08:00
Anthony Sottile
755b8000f6
move Hook data type to a separate file
2020-01-15 14:20:51 -08:00
Anthony Sottile
9000e9dd41
Some manual .format() -> f-strings
2020-01-12 13:39:53 -08:00
Anthony Sottile
327ed924a3
Add types to pre-commit
2020-01-12 10:15:01 -08:00
Anthony Sottile
fa536a8693
mypy passes with check_untyped_defs
2020-01-12 09:27:04 -08:00
Anthony Sottile
30c1e8289f
upgrade hooks, pyupgrade pre-commit
2020-01-12 09:27:04 -08:00
Ryan Rhee
addc7045ba
grammar
2019-11-01 11:33:04 -04:00
Anthony Sottile
7c3404ef1f
show color in hook outputs when attached to a tty
2019-10-12 23:17:36 -07:00
Anthony Sottile
f612aeb22b
Split out cmd_output_b
2019-10-06 15:16:47 -07:00
Edgar Geier
d4a9ff4d1f
Simplify docker user fallback implementation and test
2019-07-25 11:22:59 +02:00
Edgar Geier
b43b6a61ab
Add docker uid and gid fallback tests
2019-07-23 15:14:06 +02:00
Edgar Geier
b7ce5db782
Use fallback uid and gid if os.getuid() and os.getgid() are unavailable
2019-07-23 12:38:09 +02:00
Anthony Sottile
d3b5a41830
Implement default_language_version
2019-01-05 13:15:23 -08:00
Anthony Sottile
4f9d0397b5
Add more 'no cover windows' comments
2018-12-31 14:06:10 -08:00
Anthony Sottile
b59d7197ff
Use Hook api in languages
2018-12-31 13:16:48 -08:00
Anthony Sottile
6bac405d40
Minor cleanups
2018-11-01 18:05:36 -07:00
Chris Kuehl
ba5e27e4ec
Implement concurrent execution of individual hooks
2018-10-24 16:16:10 -07:00
Anthony Sottile
7d87da8acd
Move PrefixedCommandRunner -> Prefix
2018-01-11 21:41:48 -08:00
Anthony Sottile
2e5b4fcf4c
Add comment about Z flag for selinux
2017-11-02 15:30:28 -07:00
Jimmi Dyson
f0cf940cb5
Add selinux labelling option to docker_image hook type
2017-10-23 11:11:24 +01:00
Anthony Sottile
9c3bbecab8
Add new docker_image language type.
...
`docker_image` is intended to be a lightweight hook type similar to system /
script which allows one to use an existing docker image which provides a
hook.
2017-09-02 19:49:23 -07:00
Anthony Sottile
cff98a634d
Recover from invalid python virtualenvs
2017-07-20 10:57:09 -07:00
Anthony Sottile
0c70fa4229
Use asottile/add-trailing-comma
2017-07-12 18:30:51 -07:00
Anthony Sottile
d876661345
Use a more intelligent default language version
2017-07-08 21:11:48 -07:00
Anthony Sottile
8c27f2c50b
Put the . in docker build at the end.
...
Resolves #477
2017-01-27 14:22:00 -08:00
Anthony Sottile
068c18d38a
Add first class support for golang hooks
2017-01-24 13:49:22 -08:00
Anthony Sottile
b6937f33e2
Fixups to make appveyor happy
2017-01-16 18:50:49 -08:00
Anthony Sottile
6055af8bc8
Make shlex behaviour of entry more consistent
2017-01-05 11:52:29 -08:00
Ben Picolo
8cbd56a0a5
Put user back where it was
2017-01-05 12:55:08 -05:00
Ben Picolo
54d212f0d7
Use shlex.split
2017-01-05 10:52:31 -05:00
Ben Picolo
b7bd825e15
Support docker hooks with args
2017-01-05 09:31:22 -05:00
Anthony Sottile
e022bc6735
Only --pull on initial docker build
2017-01-04 11:27:40 -08:00
Ben Picolo
b06da3e9cd
Code review tweaks
2017-01-04 13:05:54 -05:00
Ben Picolo
86c0e6d297
Inverse md5 bytesifying
2017-01-04 10:52:56 -05:00
Ben Picolo
baf254ab78
Fix user so we can mount volumes as RW
2017-01-04 10:44:18 -05:00