mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 17:14:43 +04:00
Add pre-commit try-repo
`try-repo` is useful for: - Trying out a remote hook repository without needing to configure it. - Testing a hook repository while developing it.
This commit is contained in:
parent
e8641ee0a3
commit
2c88791a7f
15 changed files with 254 additions and 110 deletions
|
|
@ -3,16 +3,16 @@ from __future__ import unicode_literals
|
|||
|
||||
import pytest
|
||||
|
||||
from pre_commit import git
|
||||
from pre_commit.manifest import Manifest
|
||||
from testing.fixtures import make_repo
|
||||
from testing.util import get_head_sha
|
||||
|
||||
|
||||
@pytest.yield_fixture
|
||||
def manifest(store, tempdir_factory):
|
||||
path = make_repo(tempdir_factory, 'script_hooks_repo')
|
||||
repo_path = store.clone(path, get_head_sha(path))
|
||||
yield Manifest(repo_path, path)
|
||||
repo_path = store.clone(path, git.head_sha(path))
|
||||
yield Manifest(repo_path)
|
||||
|
||||
|
||||
def test_manifest_contents(manifest):
|
||||
|
|
@ -62,8 +62,8 @@ def test_hooks(manifest):
|
|||
|
||||
def test_default_python_language_version(store, tempdir_factory):
|
||||
path = make_repo(tempdir_factory, 'python_hooks_repo')
|
||||
repo_path = store.clone(path, get_head_sha(path))
|
||||
manifest = Manifest(repo_path, path)
|
||||
repo_path = store.clone(path, git.head_sha(path))
|
||||
manifest = Manifest(repo_path)
|
||||
|
||||
# This assertion is difficult as it is version dependent, just assert
|
||||
# that it is *something*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue