mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-27 19:38:35 -06: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:
@@ -15,13 +15,14 @@ class Runner(object):
|
||||
repository under test.
|
||||
"""
|
||||
|
||||
def __init__(self, git_root, config_file):
|
||||
def __init__(self, git_root, config_file, store_dir=None):
|
||||
self.git_root = git_root
|
||||
self.config_file = config_file
|
||||
self._store_dir = store_dir
|
||||
|
||||
@classmethod
|
||||
def create(cls, config_file):
|
||||
"""Creates a PreCommitRunner by doing the following:
|
||||
"""Creates a Runner by doing the following:
|
||||
- Finds the root of the current git repository
|
||||
- chdir to that directory
|
||||
"""
|
||||
@@ -63,4 +64,4 @@ class Runner(object):
|
||||
|
||||
@cached_property
|
||||
def store(self):
|
||||
return Store()
|
||||
return Store(self._store_dir)
|
||||
|
||||
Reference in New Issue
Block a user