summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-01-27 16:04:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-01-27 16:04:10 +0000
commita971f38b11f5955f6ea4f7922233d8324a5c6753 (patch)
tree5a424740e9cee97bc1c8053fea07db935c27b659 /testing
parentAdding upstream version 2.8.2. (diff)
downloadpre-commit-a971f38b11f5955f6ea4f7922233d8324a5c6753.tar.xz
pre-commit-a971f38b11f5955f6ea4f7922233d8324a5c6753.zip
Adding upstream version 2.9.3.upstream/2.9.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing')
-rwxr-xr-xtesting/resources/exclude_types_repo/bin/hook.sh2
-rwxr-xr-xtesting/resources/failing_hook_repo/bin/hook.sh2
-rwxr-xr-xtesting/resources/modified_file_returns_zero_repo/bin/hook2.sh2
-rwxr-xr-xtesting/resources/script_hooks_repo/bin/hook.sh2
-rw-r--r--testing/resources/types_or_repo/.pre-commit-hooks.yaml6
-rwxr-xr-xtesting/resources/types_or_repo/bin/hook.sh3
-rwxr-xr-xtesting/resources/types_repo/bin/hook.sh2
-rwxr-xr-xtesting/zipapp/make3
8 files changed, 17 insertions, 5 deletions
diff --git a/testing/resources/exclude_types_repo/bin/hook.sh b/testing/resources/exclude_types_repo/bin/hook.sh
index bdade51..a828db4 100755
--- a/testing/resources/exclude_types_repo/bin/hook.sh
+++ b/testing/resources/exclude_types_repo/bin/hook.sh
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
-echo $@
+echo "$@"
exit 1
diff --git a/testing/resources/failing_hook_repo/bin/hook.sh b/testing/resources/failing_hook_repo/bin/hook.sh
index 229ccaf..7dcffeb 100755
--- a/testing/resources/failing_hook_repo/bin/hook.sh
+++ b/testing/resources/failing_hook_repo/bin/hook.sh
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
echo 'Fail'
-echo $@
+echo "$@"
exit 1
diff --git a/testing/resources/modified_file_returns_zero_repo/bin/hook2.sh b/testing/resources/modified_file_returns_zero_repo/bin/hook2.sh
index 5af177a..a9f1dcd 100755
--- a/testing/resources/modified_file_returns_zero_repo/bin/hook2.sh
+++ b/testing/resources/modified_file_returns_zero_repo/bin/hook2.sh
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
-echo $@
+echo "$@"
diff --git a/testing/resources/script_hooks_repo/bin/hook.sh b/testing/resources/script_hooks_repo/bin/hook.sh
index 6565ee4..cbc4b35 100755
--- a/testing/resources/script_hooks_repo/bin/hook.sh
+++ b/testing/resources/script_hooks_repo/bin/hook.sh
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
-echo $@
+echo "$@"
echo 'Hello World'
diff --git a/testing/resources/types_or_repo/.pre-commit-hooks.yaml b/testing/resources/types_or_repo/.pre-commit-hooks.yaml
new file mode 100644
index 0000000..a4ea920
--- /dev/null
+++ b/testing/resources/types_or_repo/.pre-commit-hooks.yaml
@@ -0,0 +1,6 @@
+- id: python-cython-files
+ name: Python and Cython files
+ entry: bin/hook.sh
+ language: script
+ types: [file]
+ types_or: [python, cython]
diff --git a/testing/resources/types_or_repo/bin/hook.sh b/testing/resources/types_or_repo/bin/hook.sh
new file mode 100755
index 0000000..a828db4
--- /dev/null
+++ b/testing/resources/types_or_repo/bin/hook.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+echo "$@"
+exit 1
diff --git a/testing/resources/types_repo/bin/hook.sh b/testing/resources/types_repo/bin/hook.sh
index bdade51..a828db4 100755
--- a/testing/resources/types_repo/bin/hook.sh
+++ b/testing/resources/types_repo/bin/hook.sh
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
-echo $@
+echo "$@"
exit 1
diff --git a/testing/zipapp/make b/testing/zipapp/make
index a644946..8740b2f 100755
--- a/testing/zipapp/make
+++ b/testing/zipapp/make
@@ -99,6 +99,9 @@ def main() -> int:
shebang = '/usr/bin/env python3'
zipapp.create_archive(tmpdir, filename, interpreter=shebang)
+ with open(f'{filename}.sha256sum', 'w') as f:
+ subprocess.check_call(('sha256sum', filename), stdout=f)
+
return 0