Run pre-commit autoupdate

Committed via https://github.com/asottile/all-repos
This commit is contained in:
Anthony Sottile 2019-03-21 21:09:33 -07:00
parent 06d01c8c9d
commit dc28922ccb
11 changed files with 125 additions and 101 deletions

View file

@ -33,41 +33,47 @@ def test_check_type_tag_failures(value):
@pytest.mark.parametrize(
('config_obj', 'expected'), (
(
{'repos': [{
'repo': 'git@github.com:pre-commit/pre-commit-hooks',
'rev': 'cd74dc150c142c3be70b24eaf0b02cae9d235f37',
'hooks': [{'id': 'pyflakes', 'files': '\\.py$'}],
}]},
{
'repos': [{
'repo': 'git@github.com:pre-commit/pre-commit-hooks',
'rev': 'cd74dc150c142c3be70b24eaf0b02cae9d235f37',
'hooks': [{'id': 'pyflakes', 'files': '\\.py$'}],
}],
},
True,
),
(
{'repos': [{
'repo': 'git@github.com:pre-commit/pre-commit-hooks',
'rev': 'cd74dc150c142c3be70b24eaf0b02cae9d235f37',
'hooks': [
{
'id': 'pyflakes',
'files': '\\.py$',
'args': ['foo', 'bar', 'baz'],
},
],
}]},
{
'repos': [{
'repo': 'git@github.com:pre-commit/pre-commit-hooks',
'rev': 'cd74dc150c142c3be70b24eaf0b02cae9d235f37',
'hooks': [
{
'id': 'pyflakes',
'files': '\\.py$',
'args': ['foo', 'bar', 'baz'],
},
],
}],
},
True,
),
(
{'repos': [{
'repo': 'git@github.com:pre-commit/pre-commit-hooks',
'rev': 'cd74dc150c142c3be70b24eaf0b02cae9d235f37',
'hooks': [
{
'id': 'pyflakes',
'files': '\\.py$',
# Exclude pattern must be a string
'exclude': 0,
'args': ['foo', 'bar', 'baz'],
},
],
}]},
{
'repos': [{
'repo': 'git@github.com:pre-commit/pre-commit-hooks',
'rev': 'cd74dc150c142c3be70b24eaf0b02cae9d235f37',
'hooks': [
{
'id': 'pyflakes',
'files': '\\.py$',
# Exclude pattern must be a string
'exclude': 0,
'args': ['foo', 'bar', 'baz'],
},
],
}],
},
False,
),
),

View file

@ -33,11 +33,9 @@ def no_warnings(recwarn):
message.startswith('Not importing directory ') and
' missing __init__' in message
):
warnings.append('{}:{} {}'.format(
warning.filename,
warning.lineno,
message,
))
warnings.append(
'{}:{} {}'.format(warning.filename, warning.lineno, message),
)
assert not warnings

View file

@ -22,9 +22,9 @@ def test_install_rbenv(tempdir_factory):
# Should be able to activate using our script and access rbenv
cmd_output(
'bash', '-c',
'. {} && rbenv --help'.format(pipes.quote(prefix.path(
'rbenv-default', 'bin', 'activate',
))),
'. {} && rbenv --help'.format(
pipes.quote(prefix.path('rbenv-default', 'bin', 'activate')),
),
)
@ -36,7 +36,7 @@ def test_install_rbenv_with_version(tempdir_factory):
# Should be able to activate and use rbenv install
cmd_output(
'bash', '-c',
'. {} && rbenv install --help'.format(pipes.quote(prefix.path(
'rbenv-1.9.3p547', 'bin', 'activate',
))),
'. {} && rbenv install --help'.format(
pipes.quote(prefix.path('rbenv-1.9.3p547', 'bin', 'activate')),
),
)

View file

@ -66,9 +66,9 @@ def test_find_executable_path_ext(in_tmpdir):
"""Windows exports PATHEXT as a list of extensions to automatically add
to executables when doing PATH searching.
"""
exe_path = os.path.abspath(write_executable(
'/usr/bin/env sh', filename='run.myext',
))
exe_path = os.path.abspath(
write_executable('/usr/bin/env sh', filename='run.myext'),
)
env_path = {'PATH': os.path.dirname(exe_path)}
env_path_ext = dict(env_path, PATHEXT=os.pathsep.join(('.exe', '.myext')))
assert parse_shebang.find_executable('run') is None

View file

@ -291,9 +291,11 @@ def test_additional_rust_cli_dependencies_installed(
# A small rust package with no dependencies.
config['hooks'][0]['additional_dependencies'] = [dep]
hook = _get_hook(config, store, 'rust-hook')
binaries = os.listdir(hook.prefix.path(
helpers.environment_dir(rust.ENVIRONMENT_DIR, C.DEFAULT), 'bin',
))
binaries = os.listdir(
hook.prefix.path(
helpers.environment_dir(rust.ENVIRONMENT_DIR, C.DEFAULT), 'bin',
),
)
# normalize for windows
binaries = [os.path.splitext(binary)[0] for binary in binaries]
assert 'shellharden' in binaries
@ -308,9 +310,11 @@ def test_additional_rust_lib_dependencies_installed(
deps = ['shellharden:3.1.0']
config['hooks'][0]['additional_dependencies'] = deps
hook = _get_hook(config, store, 'rust-hook')
binaries = os.listdir(hook.prefix.path(
helpers.environment_dir(rust.ENVIRONMENT_DIR, C.DEFAULT), 'bin',
))
binaries = os.listdir(
hook.prefix.path(
helpers.environment_dir(rust.ENVIRONMENT_DIR, C.DEFAULT), 'bin',
),
)
# normalize for windows
binaries = [os.path.splitext(binary)[0] for binary in binaries]
assert 'rust-hello-world' in binaries
@ -507,9 +511,11 @@ def test_additional_golang_dependencies_installed(
deps = ['github.com/golang/example/hello']
config['hooks'][0]['additional_dependencies'] = deps
hook = _get_hook(config, store, 'golang-hook')
binaries = os.listdir(hook.prefix.path(
helpers.environment_dir(golang.ENVIRONMENT_DIR, C.DEFAULT), 'bin',
))
binaries = os.listdir(
hook.prefix.path(
helpers.environment_dir(golang.ENVIRONMENT_DIR, C.DEFAULT), 'bin',
),
)
# normalize for windows
binaries = [os.path.splitext(binary)[0] for binary in binaries]
assert 'hello' in binaries