Adding upstream version 2.2.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
18c908e4f3
commit
c0d06915b7
199 changed files with 14930 additions and 0 deletions
testing/resources
arbitrary_bytes_repo
arg_per_line_hooks_repo
conda_hooks_repo
docker_hooks_repo
docker_image_hooks_repo
exclude_types_repo
failing_hook_repo
golang_hooks_repo
img1.jpgimg2.jpgimg3.jpglogfile_repo
modified_file_returns_zero_repo
node_hooks_repo
node_versioned_hooks_repo
not_found_exe
perl_hooks_repo
prints_cwd_repo
python3_hooks_repo
python_hooks_repo
python_venv_hooks_repo
ruby_hooks_repo
ruby_versioned_hooks_repo
rust_hooks_repo
script_hooks_repo
stdout_stderr_repo
swift_hooks_repo
system_hook_with_spaces_repo
types_repo
|
@ -0,0 +1,5 @@
|
|||
- id: hook
|
||||
name: hook
|
||||
entry: ./hook.sh
|
||||
language: script
|
||||
files: \.py$
|
7
testing/resources/arbitrary_bytes_repo/hook.sh
Executable file
7
testing/resources/arbitrary_bytes_repo/hook.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
# Intentionally write mixed encoding to the output. This should not crash
|
||||
# pre-commit and should write bytes to the output.
|
||||
# '☃'.encode() + '²'.encode('latin1')
|
||||
echo -e '\xe2\x98\x83\xb2'
|
||||
# exit 1 to trigger printing
|
||||
exit 1
|
|
@ -0,0 +1,6 @@
|
|||
- id: arg-per-line
|
||||
name: Args per line hook
|
||||
entry: bin/hook.sh
|
||||
language: script
|
||||
files: ''
|
||||
args: [hello, world]
|
5
testing/resources/arg_per_line_hooks_repo/bin/hook.sh
Executable file
5
testing/resources/arg_per_line_hooks_repo/bin/hook.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
for i in "$@"; do
|
||||
echo "arg: $i"
|
||||
done
|
10
testing/resources/conda_hooks_repo/.pre-commit-hooks.yaml
Normal file
10
testing/resources/conda_hooks_repo/.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
- id: sys-exec
|
||||
name: sys-exec
|
||||
entry: python -c 'import os; import sys; print(sys.executable.split(os.path.sep)[-2]) if os.name == "nt" else print(sys.executable.split(os.path.sep)[-3])'
|
||||
language: conda
|
||||
files: \.py$
|
||||
- id: additional-deps
|
||||
name: additional-deps
|
||||
entry: python
|
||||
language: conda
|
||||
files: \.py$
|
6
testing/resources/conda_hooks_repo/environment.yml
Normal file
6
testing/resources/conda_hooks_repo/environment.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
channels:
|
||||
- conda-forge
|
||||
- defaults
|
||||
dependencies:
|
||||
- python
|
||||
- pip
|
17
testing/resources/docker_hooks_repo/.pre-commit-hooks.yaml
Normal file
17
testing/resources/docker_hooks_repo/.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
- id: docker-hook
|
||||
name: Docker test hook
|
||||
entry: echo
|
||||
language: docker
|
||||
files: \.txt$
|
||||
|
||||
- id: docker-hook-arg
|
||||
name: Docker test hook
|
||||
entry: echo -n
|
||||
language: docker
|
||||
files: \.txt$
|
||||
|
||||
- id: docker-hook-failing
|
||||
name: Docker test hook with nonzero exit code
|
||||
entry: bork
|
||||
language: docker
|
||||
files: \.txt$
|
3
testing/resources/docker_hooks_repo/Dockerfile
Normal file
3
testing/resources/docker_hooks_repo/Dockerfile
Normal file
|
@ -0,0 +1,3 @@
|
|||
FROM cogniteev/echo
|
||||
|
||||
CMD ["echo", "This is overwritten by the .pre-commit-hooks.yaml 'entry'"]
|
|
@ -0,0 +1,8 @@
|
|||
- id: echo-entrypoint
|
||||
name: echo (via --entrypoint)
|
||||
language: docker_image
|
||||
entry: --entrypoint echo cogniteev/echo
|
||||
- id: echo-cmd
|
||||
name: echo (via cmd)
|
||||
language: docker_image
|
||||
entry: cogniteev/echo echo
|
|
@ -0,0 +1,6 @@
|
|||
- id: python-files
|
||||
name: Python files
|
||||
entry: bin/hook.sh
|
||||
language: script
|
||||
types: [python]
|
||||
exclude_types: [python3]
|
3
testing/resources/exclude_types_repo/bin/hook.sh
Executable file
3
testing/resources/exclude_types_repo/bin/hook.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
echo $@
|
||||
exit 1
|
|
@ -0,0 +1,5 @@
|
|||
- id: failing_hook
|
||||
name: Failing hook
|
||||
entry: bin/hook.sh
|
||||
language: script
|
||||
files: .
|
4
testing/resources/failing_hook_repo/bin/hook.sh
Executable file
4
testing/resources/failing_hook_repo/bin/hook.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
echo 'Fail'
|
||||
echo $@
|
||||
exit 1
|
|
@ -0,0 +1,5 @@
|
|||
- id: golang-hook
|
||||
name: golang example hook
|
||||
entry: golang-hello-world
|
||||
language: golang
|
||||
files: ''
|
|
@ -0,0 +1,17 @@
|
|||
package main
|
||||
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/BurntSushi/toml"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
What string
|
||||
}
|
||||
|
||||
func main() {
|
||||
var conf Config
|
||||
toml.Decode("What = 'world'\n", &conf)
|
||||
fmt.Printf("hello %v\n", conf.What)
|
||||
}
|
BIN
testing/resources/img1.jpg
Normal file
BIN
testing/resources/img1.jpg
Normal file
Binary file not shown.
After ![]() (image error) Size: 843 B |
BIN
testing/resources/img2.jpg
Normal file
BIN
testing/resources/img2.jpg
Normal file
Binary file not shown.
After ![]() (image error) Size: 891 B |
BIN
testing/resources/img3.jpg
Normal file
BIN
testing/resources/img3.jpg
Normal file
Binary file not shown.
After ![]() (image error) Size: 859 B |
6
testing/resources/logfile_repo/.pre-commit-hooks.yaml
Normal file
6
testing/resources/logfile_repo/.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
- id: logfile test hook
|
||||
name: Logfile test hook
|
||||
entry: bin/hook.sh
|
||||
language: script
|
||||
files: .
|
||||
log_file: test.log
|
5
testing/resources/logfile_repo/bin/hook.sh
Executable file
5
testing/resources/logfile_repo/bin/hook.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
echo "This is STDOUT output"
|
||||
echo "This is STDERR output" 1>&2
|
||||
|
||||
exit 1
|
|
@ -0,0 +1,15 @@
|
|||
- id: bash_hook
|
||||
name: Bash hook
|
||||
entry: bin/hook.sh
|
||||
language: script
|
||||
files: 'foo.py'
|
||||
- id: bash_hook2
|
||||
name: Bash hook
|
||||
entry: bin/hook2.sh
|
||||
language: script
|
||||
files: ''
|
||||
- id: bash_hook3
|
||||
name: Bash hook
|
||||
entry: bin/hook3.sh
|
||||
language: script
|
||||
files: 'bar.py'
|
7
testing/resources/modified_file_returns_zero_repo/bin/hook.sh
Executable file
7
testing/resources/modified_file_returns_zero_repo/bin/hook.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
for f in $@; do
|
||||
# Non UTF-8 bytes
|
||||
echo -e '\x01\x97' > "$f"
|
||||
echo "Modified: $f!"
|
||||
done
|
2
testing/resources/modified_file_returns_zero_repo/bin/hook2.sh
Executable file
2
testing/resources/modified_file_returns_zero_repo/bin/hook2.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
echo $@
|
6
testing/resources/modified_file_returns_zero_repo/bin/hook3.sh
Executable file
6
testing/resources/modified_file_returns_zero_repo/bin/hook3.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
for f in $@; do
|
||||
# Non UTF-8 bytes
|
||||
echo -e '\x01\x97' > "$f"
|
||||
done
|
5
testing/resources/node_hooks_repo/.pre-commit-hooks.yaml
Normal file
5
testing/resources/node_hooks_repo/.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- id: foo
|
||||
name: Foo
|
||||
entry: foo
|
||||
language: node
|
||||
files: \.js$
|
3
testing/resources/node_hooks_repo/bin/main.js
Normal file
3
testing/resources/node_hooks_repo/bin/main.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
console.log('Hello World');
|
5
testing/resources/node_hooks_repo/package.json
Normal file
5
testing/resources/node_hooks_repo/package.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "foo",
|
||||
"version": "0.0.1",
|
||||
"bin": {"foo": "./bin/main.js"}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
- id: versioned-node-hook
|
||||
name: Versioned node hook
|
||||
entry: versioned-node-hook
|
||||
language: node
|
||||
language_version: 9.3.0
|
||||
files: \.js$
|
4
testing/resources/node_versioned_hooks_repo/bin/main.js
Normal file
4
testing/resources/node_versioned_hooks_repo/bin/main.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
console.log(process.version);
|
||||
console.log('Hello World');
|
5
testing/resources/node_versioned_hooks_repo/package.json
Normal file
5
testing/resources/node_versioned_hooks_repo/package.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "versioned-node-hook",
|
||||
"version": "0.0.1",
|
||||
"bin": {"versioned-node-hook": "./bin/main.js"}
|
||||
}
|
5
testing/resources/not_found_exe/.pre-commit-hooks.yaml
Normal file
5
testing/resources/not_found_exe/.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- id: not-found-exe
|
||||
name: Not found exe
|
||||
entry: i-dont-exist-lol
|
||||
language: system
|
||||
files: ''
|
7
testing/resources/perl_hooks_repo/.gitignore
vendored
Normal file
7
testing/resources/perl_hooks_repo/.gitignore
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
/MYMETA.json
|
||||
/MYMETA.yml
|
||||
/Makefile
|
||||
/PreCommitHello-*.tar.*
|
||||
/PreCommitHello-*/
|
||||
/blib/
|
||||
/pm_to_blib
|
5
testing/resources/perl_hooks_repo/.pre-commit-hooks.yaml
Normal file
5
testing/resources/perl_hooks_repo/.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- id: perl-hook
|
||||
name: perl example hook
|
||||
entry: pre-commit-perl-hello
|
||||
language: perl
|
||||
files: ''
|
4
testing/resources/perl_hooks_repo/MANIFEST
Normal file
4
testing/resources/perl_hooks_repo/MANIFEST
Normal file
|
@ -0,0 +1,4 @@
|
|||
MANIFEST
|
||||
Makefile.PL
|
||||
bin/pre-commit-perl-hello
|
||||
lib/PreCommitHello.pm
|
10
testing/resources/perl_hooks_repo/Makefile.PL
Normal file
10
testing/resources/perl_hooks_repo/Makefile.PL
Normal file
|
@ -0,0 +1,10 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
|
||||
use ExtUtils::MakeMaker;
|
||||
|
||||
WriteMakefile(
|
||||
NAME => "PreCommitHello",
|
||||
VERSION_FROM => "lib/PreCommitHello.pm",
|
||||
EXE_FILES => [qw(bin/pre-commit-perl-hello)],
|
||||
);
|
7
testing/resources/perl_hooks_repo/bin/pre-commit-perl-hello
Executable file
7
testing/resources/perl_hooks_repo/bin/pre-commit-perl-hello
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use PreCommitHello;
|
||||
|
||||
PreCommitHello::hello();
|
12
testing/resources/perl_hooks_repo/lib/PreCommitHello.pm
Normal file
12
testing/resources/perl_hooks_repo/lib/PreCommitHello.pm
Normal file
|
@ -0,0 +1,12 @@
|
|||
package PreCommitHello;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $VERSION = "0.1.0";
|
||||
|
||||
sub hello {
|
||||
print "Hello from perl-commit Perl!\n";
|
||||
}
|
||||
|
||||
1;
|
5
testing/resources/prints_cwd_repo/.pre-commit-hooks.yaml
Normal file
5
testing/resources/prints_cwd_repo/.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- id: prints_cwd
|
||||
name: Prints Cwd
|
||||
entry: pwd
|
||||
language: system
|
||||
files: \.sh$
|
|
@ -0,0 +1,6 @@
|
|||
- id: python3-hook
|
||||
name: Python 3 Hook
|
||||
entry: python3-hook
|
||||
language: python
|
||||
language_version: python3
|
||||
files: \.py$
|
8
testing/resources/python3_hooks_repo/py3_hook.py
Normal file
8
testing/resources/python3_hooks_repo/py3_hook.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
print(sys.version_info[0])
|
||||
print(repr(sys.argv[1:]))
|
||||
print('Hello World')
|
||||
return 0
|
8
testing/resources/python3_hooks_repo/setup.py
Normal file
8
testing/resources/python3_hooks_repo/setup.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='python3_hook',
|
||||
version='0.0.0',
|
||||
py_modules=['py3_hook'],
|
||||
entry_points={'console_scripts': ['python3-hook = py3_hook:main']},
|
||||
)
|
|
@ -0,0 +1,5 @@
|
|||
- id: foo
|
||||
name: Foo
|
||||
entry: foo
|
||||
language: python
|
||||
files: \.py$
|
7
testing/resources/python_hooks_repo/foo.py
Normal file
7
testing/resources/python_hooks_repo/foo.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
print(repr(sys.argv[1:]))
|
||||
print('Hello World')
|
||||
return 0
|
8
testing/resources/python_hooks_repo/setup.py
Normal file
8
testing/resources/python_hooks_repo/setup.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='foo',
|
||||
version='0.0.0',
|
||||
py_modules=['foo'],
|
||||
entry_points={'console_scripts': ['foo = foo:main']},
|
||||
)
|
|
@ -0,0 +1,5 @@
|
|||
- id: foo
|
||||
name: Foo
|
||||
entry: foo
|
||||
language: python_venv
|
||||
files: \.py$
|
7
testing/resources/python_venv_hooks_repo/foo.py
Normal file
7
testing/resources/python_venv_hooks_repo/foo.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
print(repr(sys.argv[1:]))
|
||||
print('Hello World')
|
||||
return 0
|
8
testing/resources/python_venv_hooks_repo/setup.py
Normal file
8
testing/resources/python_venv_hooks_repo/setup.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='foo',
|
||||
version='0.0.0',
|
||||
py_modules=['foo'],
|
||||
entry_points={'console_scripts': ['foo = foo:main']},
|
||||
)
|
1
testing/resources/ruby_hooks_repo/.gitignore
vendored
Normal file
1
testing/resources/ruby_hooks_repo/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*.gem
|
5
testing/resources/ruby_hooks_repo/.pre-commit-hooks.yaml
Normal file
5
testing/resources/ruby_hooks_repo/.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- id: ruby_hook
|
||||
name: Ruby Hook
|
||||
entry: ruby_hook
|
||||
language: ruby
|
||||
files: \.rb$
|
3
testing/resources/ruby_hooks_repo/bin/ruby_hook
Executable file
3
testing/resources/ruby_hooks_repo/bin/ruby_hook
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
puts 'Hello world from a ruby hook'
|
0
testing/resources/ruby_hooks_repo/lib/.gitignore
vendored
Normal file
0
testing/resources/ruby_hooks_repo/lib/.gitignore
vendored
Normal file
9
testing/resources/ruby_hooks_repo/ruby_hook.gemspec
Normal file
9
testing/resources/ruby_hooks_repo/ruby_hook.gemspec
Normal file
|
@ -0,0 +1,9 @@
|
|||
Gem::Specification.new do |s|
|
||||
s.name = 'ruby_hook'
|
||||
s.version = '0.1.0'
|
||||
s.authors = ['Anthony Sottile']
|
||||
s.summary = 'A ruby hook!'
|
||||
s.description = 'A ruby hook!'
|
||||
s.files = ['bin/ruby_hook']
|
||||
s.executables = ['ruby_hook']
|
||||
end
|
1
testing/resources/ruby_versioned_hooks_repo/.gitignore
vendored
Normal file
1
testing/resources/ruby_versioned_hooks_repo/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*.gem
|
|
@ -0,0 +1,6 @@
|
|||
- id: ruby_hook
|
||||
name: Ruby Hook
|
||||
entry: ruby_hook
|
||||
language: ruby
|
||||
language_version: 2.5.1
|
||||
files: \.rb$
|
4
testing/resources/ruby_versioned_hooks_repo/bin/ruby_hook
Executable file
4
testing/resources/ruby_versioned_hooks_repo/bin/ruby_hook
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
puts RUBY_VERSION
|
||||
puts 'Hello world from a ruby hook'
|
0
testing/resources/ruby_versioned_hooks_repo/lib/.gitignore
vendored
Normal file
0
testing/resources/ruby_versioned_hooks_repo/lib/.gitignore
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
Gem::Specification.new do |s|
|
||||
s.name = 'ruby_hook'
|
||||
s.version = '0.1.0'
|
||||
s.authors = ['Anthony Sottile']
|
||||
s.summary = 'A ruby hook!'
|
||||
s.description = 'A ruby hook!'
|
||||
s.files = ['bin/ruby_hook']
|
||||
s.executables = ['ruby_hook']
|
||||
end
|
5
testing/resources/rust_hooks_repo/.pre-commit-hooks.yaml
Normal file
5
testing/resources/rust_hooks_repo/.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- id: rust-hook
|
||||
name: rust example hook
|
||||
entry: rust-hello-world
|
||||
language: rust
|
||||
files: ''
|
3
testing/resources/rust_hooks_repo/Cargo.lock
generated
Normal file
3
testing/resources/rust_hooks_repo/Cargo.lock
generated
Normal file
|
@ -0,0 +1,3 @@
|
|||
[[package]]
|
||||
name = "rust-hello-world"
|
||||
version = "0.1.0"
|
3
testing/resources/rust_hooks_repo/Cargo.toml
Normal file
3
testing/resources/rust_hooks_repo/Cargo.toml
Normal file
|
@ -0,0 +1,3 @@
|
|||
[package]
|
||||
name = "rust-hello-world"
|
||||
version = "0.1.0"
|
3
testing/resources/rust_hooks_repo/src/main.rs
Normal file
3
testing/resources/rust_hooks_repo/src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("hello world");
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
- id: bash_hook
|
||||
name: Bash hook
|
||||
entry: bin/hook.sh
|
||||
language: script
|
||||
files: ''
|
4
testing/resources/script_hooks_repo/bin/hook.sh
Executable file
4
testing/resources/script_hooks_repo/bin/hook.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo $@
|
||||
echo 'Hello World'
|
|
@ -0,0 +1,8 @@
|
|||
- id: stdout-stderr
|
||||
name: stdout-stderr
|
||||
language: script
|
||||
entry: ./stdout-stderr-entry
|
||||
- id: tty-check
|
||||
name: tty-check
|
||||
language: script
|
||||
entry: ./tty-check-entry
|
7
testing/resources/stdout_stderr_repo/stdout-stderr-entry
Executable file
7
testing/resources/stdout_stderr_repo/stdout-stderr-entry
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
echo 0
|
||||
echo 1 1>&2
|
||||
echo 2
|
||||
echo 3 1>&2
|
||||
echo 4
|
||||
echo 5 1>&2
|
11
testing/resources/stdout_stderr_repo/tty-check-entry
Executable file
11
testing/resources/stdout_stderr_repo/tty-check-entry
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
t() {
|
||||
if [ -t "$1" ]; then
|
||||
echo "$2: True"
|
||||
else
|
||||
echo "$2: False"
|
||||
fi
|
||||
}
|
||||
t 0 stdin
|
||||
t 1 stdout
|
||||
t 2 stderr
|
4
testing/resources/swift_hooks_repo/.gitignore
vendored
Normal file
4
testing/resources/swift_hooks_repo/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
.DS_Store
|
||||
/.build
|
||||
/Packages
|
||||
/*.xcodeproj
|
|
@ -0,0 +1,6 @@
|
|||
- id: swift-hooks-repo
|
||||
name: Swift hooks repo example
|
||||
description: Runs the hello world app generated by swift package init --type executable (binary called swift_hooks_repo here)
|
||||
entry: swift_hooks_repo
|
||||
language: swift
|
||||
files: \.(swift)$
|
7
testing/resources/swift_hooks_repo/Package.swift
Normal file
7
testing/resources/swift_hooks_repo/Package.swift
Normal file
|
@ -0,0 +1,7 @@
|
|||
// swift-tools-version:5.0
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "swift_hooks_repo",
|
||||
targets: [.target(name: "swift_hooks_repo")]
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
print("Hello, world!")
|
|
@ -0,0 +1,5 @@
|
|||
- id: system-hook-with-spaces
|
||||
name: System hook with spaces
|
||||
entry: bash -c 'echo "Hello World"'
|
||||
language: system
|
||||
files: \.sh$
|
5
testing/resources/types_repo/.pre-commit-hooks.yaml
Normal file
5
testing/resources/types_repo/.pre-commit-hooks.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- id: python-files
|
||||
name: Python files
|
||||
entry: bin/hook.sh
|
||||
language: script
|
||||
types: [python]
|
3
testing/resources/types_repo/bin/hook.sh
Executable file
3
testing/resources/types_repo/bin/hook.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
echo $@
|
||||
exit 1
|
Loading…
Add table
Add a link
Reference in a new issue