diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-21 19:59:08 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-21 19:59:08 +0000 |
commit | 20ff60e9f0e8528b00b03e036fa3d41743d53dfa (patch) | |
tree | 7baccf4096b08411ca191790015c7f6c835a85c7 /testing | |
parent | Adding upstream version 2.16.0. (diff) | |
download | pre-commit-20ff60e9f0e8528b00b03e036fa3d41743d53dfa.tar.xz pre-commit-20ff60e9f0e8528b00b03e036fa3d41743d53dfa.zip |
Adding upstream version 2.17.0.upstream/2.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing')
-rwxr-xr-x | testing/gen-languages-all | 2 | ||||
-rwxr-xr-x | testing/get-lua.sh | 5 | ||||
-rwxr-xr-x | testing/make-archives | 4 | ||||
-rw-r--r-- | testing/resources/docker_hooks_repo/Dockerfile | 2 | ||||
-rw-r--r-- | testing/resources/docker_image_hooks_repo/.pre-commit-hooks.yaml | 4 | ||||
-rw-r--r-- | testing/resources/lua_repo/.pre-commit-hooks.yaml | 4 | ||||
-rwxr-xr-x | testing/resources/lua_repo/bin/hello-world-lua | 3 | ||||
-rw-r--r-- | testing/resources/lua_repo/hello-dev-1.rockspec | 15 | ||||
-rw-r--r-- | testing/util.py | 4 | ||||
-rwxr-xr-x | testing/zipapp/make | 2 |
10 files changed, 38 insertions, 7 deletions
diff --git a/testing/gen-languages-all b/testing/gen-languages-all index c933c14..152cf3c 100755 --- a/testing/gen-languages-all +++ b/testing/gen-languages-all @@ -3,7 +3,7 @@ import sys LANGUAGES = [ 'conda', 'coursier', 'dart', 'docker', 'docker_image', 'dotnet', 'fail', - 'golang', 'node', 'perl', 'pygrep', 'python', 'r', 'ruby', 'rust', + 'golang', 'lua', 'node', 'perl', 'pygrep', 'python', 'r', 'ruby', 'rust', 'script', 'swift', 'system', ] FIELDS = [ diff --git a/testing/get-lua.sh b/testing/get-lua.sh new file mode 100755 index 0000000..580e247 --- /dev/null +++ b/testing/get-lua.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Install the runtime and package manager. +sudo apt install lua5.3 liblua5.3-dev luarocks diff --git a/testing/make-archives b/testing/make-archives index 707fd88..ce098ba 100755 --- a/testing/make-archives +++ b/testing/make-archives @@ -15,8 +15,8 @@ from typing import Sequence REPOS = ( - ('rbenv', 'https://github.com/rbenv/rbenv', '585ed84'), - ('ruby-build', 'https://github.com/rbenv/ruby-build', 'e9fa4bf'), + ('rbenv', 'https://github.com/rbenv/rbenv', '38e1fbb'), + ('ruby-build', 'https://github.com/rbenv/ruby-build', '8663d2f'), ( 'ruby-download', 'https://github.com/garnieretienne/rvm-download', diff --git a/testing/resources/docker_hooks_repo/Dockerfile b/testing/resources/docker_hooks_repo/Dockerfile index 841b151..0bd1de0 100644 --- a/testing/resources/docker_hooks_repo/Dockerfile +++ b/testing/resources/docker_hooks_repo/Dockerfile @@ -1,3 +1,3 @@ -FROM cogniteev/echo +FROM ubuntu:focal CMD ["echo", "This is overwritten by the .pre-commit-hooks.yaml 'entry'"] diff --git a/testing/resources/docker_image_hooks_repo/.pre-commit-hooks.yaml b/testing/resources/docker_image_hooks_repo/.pre-commit-hooks.yaml index 1b385aa..e9fb245 100644 --- a/testing/resources/docker_image_hooks_repo/.pre-commit-hooks.yaml +++ b/testing/resources/docker_image_hooks_repo/.pre-commit-hooks.yaml @@ -1,8 +1,8 @@ - id: echo-entrypoint name: echo (via --entrypoint) language: docker_image - entry: --entrypoint echo cogniteev/echo + entry: --entrypoint echo ubuntu:focal - id: echo-cmd name: echo (via cmd) language: docker_image - entry: cogniteev/echo echo + entry: ubuntu:focal echo diff --git a/testing/resources/lua_repo/.pre-commit-hooks.yaml b/testing/resources/lua_repo/.pre-commit-hooks.yaml new file mode 100644 index 0000000..767ef97 --- /dev/null +++ b/testing/resources/lua_repo/.pre-commit-hooks.yaml @@ -0,0 +1,4 @@ +- id: hello-world-lua + name: hello world lua + entry: hello-world-lua + language: lua diff --git a/testing/resources/lua_repo/bin/hello-world-lua b/testing/resources/lua_repo/bin/hello-world-lua new file mode 100755 index 0000000..2a0e002 --- /dev/null +++ b/testing/resources/lua_repo/bin/hello-world-lua @@ -0,0 +1,3 @@ +#!/usr/bin/env lua + +print('hello world') diff --git a/testing/resources/lua_repo/hello-dev-1.rockspec b/testing/resources/lua_repo/hello-dev-1.rockspec new file mode 100644 index 0000000..82486e0 --- /dev/null +++ b/testing/resources/lua_repo/hello-dev-1.rockspec @@ -0,0 +1,15 @@ +package = "hello" +version = "dev-1" + +source = { + url = "git+ssh://git@github.com/pre-commit/pre-commit.git" +} +description = {} +dependencies = {} +build = { + type = "builtin", + modules = {}, + install = { + bin = {"bin/hello-world-lua"} + }, +} diff --git a/testing/util.py b/testing/util.py index 791a2b9..283ed47 100644 --- a/testing/util.py +++ b/testing/util.py @@ -48,6 +48,10 @@ skipif_cant_run_docker = pytest.mark.skipif( os.name == 'nt' or not docker_is_running(), reason="Docker isn't running or can't be accessed", ) +skipif_cant_run_lua = pytest.mark.skipif( + os.name == 'nt', + reason="lua isn't installed or can't be found", +) skipif_cant_run_swift = pytest.mark.skipif( parse_shebang.find_executable('swift') is None, reason="swift isn't installed or can't be found", diff --git a/testing/zipapp/make b/testing/zipapp/make index 55b6d2c..effc812 100755 --- a/testing/zipapp/make +++ b/testing/zipapp/make @@ -71,7 +71,7 @@ def main() -> int: _msg('populating wheels...') _exit_if_retv( 'podman', 'run', '--rm', '--volume', f'{wheeldir}:/wheels:rw', IMG, - 'pip', 'wheel', f'pre_commit=={args.version}', + 'pip', 'wheel', f'pre_commit=={args.version}', 'setuptools', '--wheel-dir', '/wheels', ) |