mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Fix #238 : pre-commit autoupdate fails with local hooks
This commit is contained in:
parent
1c46446427
commit
b575cb510c
5 changed files with 30 additions and 14 deletions
|
|
@ -35,6 +35,19 @@ def make_repo(tmpdir_factory, repo_source):
|
|||
return path
|
||||
|
||||
|
||||
def config_with_local_hooks():
|
||||
return OrderedDict((
|
||||
('repo', 'local'),
|
||||
('hooks', [OrderedDict((
|
||||
('id', 'do_not_commit'),
|
||||
('name', 'Block if "DO NOT COMMIT" is found'),
|
||||
('entry', 'DO NOT COMMIT'),
|
||||
('language', 'pcre'),
|
||||
('files', '^(.*)$'),
|
||||
))])
|
||||
))
|
||||
|
||||
|
||||
def make_config_from_repo(repo_path, sha=None, hooks=None, check=True):
|
||||
manifest = load_manifest(os.path.join(repo_path, C.MANIFEST_FILE))
|
||||
config = OrderedDict((
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue