Introduce .pre-commit-hooks.yaml as a replacement for hooks.yaml

This commit is contained in:
Anthony Sottile 2017-01-21 13:07:37 -08:00
parent b90a598fac
commit b9e5184ebd
32 changed files with 107 additions and 21 deletions

View file

@ -45,7 +45,7 @@ def _test_hook_repo(
args,
expected,
expected_return_code=0,
config_kwargs=None
config_kwargs=None,
):
path = make_repo(tempdir_factory, repo_path)
config = make_config_from_repo(path, **(config_kwargs or {}))
@ -215,6 +215,15 @@ def test_system_hook_with_spaces(tempdir_factory, store):
)
@pytest.mark.integration
def test_repo_with_legacy_hooks_yaml(tempdir_factory, store):
_test_hook_repo(
tempdir_factory, store, 'legacy_hooks_yaml_repo',
'system-hook-with-spaces', ['/dev/null'], b'Hello World\n',
config_kwargs={'legacy': True},
)
@skipif_cant_run_swift
@pytest.mark.integration
def test_swift_hook(tempdir_factory, store):